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 C Enter record-number:1- Enter Make: Mercurye Enter Model:Sable Enter-Odometer·Reading:998424 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.0 Fuel·Level:-12.50- Enter record- number:-30-

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 29SA
icon
Related questions
Question

IN C LANGUAGE

PLEASE, take your time and put a readable, copyable code

show the output

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:Sablee
Enter.Odometer Reading:998424
Enter Month:14
Enter Day:18e
Enter Year: 2001e
Enter Month:5e
Enter Day:30d
Enter. Year:19914
Enter. Capacity:164
Enter Fuel·Level:12.5e
Make: Mercury-Model: Sable+Odometer: 99842-Manufacturer Date: 1/18/2001+Purchase Date: 5/30/1991-Tank - Capacity: 16.00d
Fuel·Level: :12.50-
Enter record - number:-30
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/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:Sablee Enter.Odometer Reading:998424 Enter Month:14 Enter Day:18e Enter Year: 2001e Enter Month:5e Enter Day:30d Enter. Year:19914 Enter. Capacity:164 Enter Fuel·Level:12.5e Make: Mercury-Model: Sable+Odometer: 99842-Manufacturer Date: 1/18/2001+Purchase Date: 5/30/1991-Tank - Capacity: 16.00d Fuel·Level: :12.50- Enter record - number:-30
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning