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/0 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:14 Enter Make: Mercurye 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+0dometer:-99842+→Manufacturer Date: 1/18/2001+Purchase Date: •5/30/1991+Tank• Capacity: 16.00- Fuel·Level:12.50- Enter record - number:-30-
IN C LANGUAGE
PLEASE PUT COPYABLE CODE
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
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