Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

IN C LANGUAGE

PLEASE PUT COPYABLE CODE

10.1) Define a structure type auto_t to represent an automobile. Include components for the make and model (strings), the odometer reading, the manufacture and
purchase dates (use another user-defined type called date_t), and the gas tank (use a user-defined type tank_t with components for tank capacity and current fuel level,
giving both in gallons). Write I/O functions scan_date, scan_tank, scan_auto, print_date, print_tank, and print_auto, and also write a driver function that repeatedly fills
and displays an auto structure variable until input is -30.
Note: Each record has a number (1, 2, 3 ...), once the program scans record number -30, it should terminate without processing it.
SAMPLE RUN #4: ./Structures
Interactive Session
Hide Invisibles
Highlight: None
Show Highlighted Only O
Enter record.number:1+
Enter Make:Mercury
Enter Model:Sable
Enter odometer Reading:99842-
Enter Month:1+
Enter Day:18-
Enter Year:2001-
Enter Month:5-
Enter Day:30+
Enter Year:1991-
Enter.Capacity:16+
Enter Fuel·Level:12.54
Make: Mercury-Model: Sable+odometer:-99842-Manufacturer Date: 1/18/2001+Purchase - Date: 5/30/1991+Tank - Capacity: 16.00-
Fuel·Level:12.50-
Enter record-number:-30-
expand button
Transcribed Image Text:10.1) Define a structure type auto_t to represent an automobile. Include components for the make and model (strings), the odometer reading, the manufacture and purchase dates (use another user-defined type called date_t), and the gas tank (use a user-defined type tank_t with components for tank capacity and current fuel level, giving both in gallons). Write I/O functions scan_date, scan_tank, scan_auto, print_date, print_tank, and print_auto, and also write a driver function that repeatedly fills and displays an auto structure variable until input is -30. Note: Each record has a number (1, 2, 3 ...), once the program scans record number -30, it should terminate without processing it. SAMPLE RUN #4: ./Structures Interactive Session Hide Invisibles Highlight: None Show Highlighted Only O Enter record.number:1+ Enter Make:Mercury Enter Model:Sable Enter odometer Reading:99842- Enter Month:1+ Enter Day:18- Enter Year:2001- Enter Month:5- Enter Day:30+ Enter Year:1991- Enter.Capacity:16+ Enter Fuel·Level:12.54 Make: Mercury-Model: Sable+odometer:-99842-Manufacturer Date: 1/18/2001+Purchase - Date: 5/30/1991+Tank - Capacity: 16.00- Fuel·Level:12.50- Enter record-number:-30-
Expert Solution
Check Mark
Still need help?
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

In C language.  Please don't copy similar programs from, bartleby or chegg

Define a structure type auto_t to represent an automobile.

Include components for the make and model (strings), the odometer reading, the manufacture and purchase dates (use another user-defined type called date_t), and the gas tank (use a user-defined type tank_t with components for tank capacity and current fuel level, giving both in gallons).

Write I/O functions scan_date, scan_tank, scan_auto, print_date, print_tank, and print_auto,

and also write a driver function that repeatedly fills and displays an auto structure variable until input is -30. Note: Each record has a number (1, 2, 3 ...),once the program scans record number -30, it should terminate without processing it.

SAMPLE RUN #4: ./Structures Interactive Session Show Invisibles Highlight:

Enter record number:1

Enter Make:Mercury

Enter Model:Sable

Enter Odometer Reading:99842

Enter Month:1 Enter Day:18

Enter Year:2001

Enter Month:5

Enter Day:30

Enter Year:1991

Enter Capacity:16

Enter Fuel Level:12.5

Make: Mercury Model: Sable Odometer: 99842 Manufacturer Date: 1/18/2001 Purchase Date: 5/30/1991 Tank Capacity: 16.00 Fuel Level: 12.50

Enter record number:-3

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

In C language.  Please don't copy similar programs from, bartleby or chegg

Define a structure type auto_t to represent an automobile.

Include components for the make and model (strings), the odometer reading, the manufacture and purchase dates (use another user-defined type called date_t), and the gas tank (use a user-defined type tank_t with components for tank capacity and current fuel level, giving both in gallons).

Write I/O functions scan_date, scan_tank, scan_auto, print_date, print_tank, and print_auto,

and also write a driver function that repeatedly fills and displays an auto structure variable until input is -30. Note: Each record has a number (1, 2, 3 ...),once the program scans record number -30, it should terminate without processing it.

SAMPLE RUN #4: ./Structures Interactive Session Show Invisibles Highlight:

Enter record number:1

Enter Make:Mercury

Enter Model:Sable

Enter Odometer Reading:99842

Enter Month:1 Enter Day:18

Enter Year:2001

Enter Month:5

Enter Day:30

Enter Year:1991

Enter Capacity:16

Enter Fuel Level:12.5

Make: Mercury Model: Sable Odometer: 99842 Manufacturer Date: 1/18/2001 Purchase Date: 5/30/1991 Tank Capacity: 16.00 Fuel Level: 12.50

Enter record number:-3

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY