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-
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
Related questions
Question
IN C LANGUAGE
PLEASE, take your time and put a readable, copyable code
show the output
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
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.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning