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-

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education