Question: Approach Create your struct ( I will call it CarData but you can name it whatever you want ) . The struct should have the

Approach
Create your struct (I will call it CarData but you can name it whatever you want). The struct should have
the following characteristics (if not explicitly stated, you get to choose):
Gas should be an enumerated type
o define the enumerated type enum GasType {gas, diesel};
Create another struct I will call BodyData to hold the body style and number of doors.
This struct will be contained inside CarData. Number of doors should be an integer (you
probably want to create a function to convert a string to an integer for the possible set
of numbers you will encounter).
Create another struct I will call Dimensions to hold the wheel base, length, width and
height. This will also be contained inside CarData.
Create another struct I will call EngineData to hold the number of cylinders (represented
as an integer), the engine size, and the horsepower. This will also be contained inside
CarData.
Create another struct I will call MPG to hold both city and highway MPG.
Create an array of CarData to hold all the cars.
Create a function to read the file, loading the data into your array.
Write a function for each of the statistics we wish to report, except write a single function for the MPG
data that returns both gas and diesel results. The array should be passed to each function.
Output the statistics to the console. Format it nicely so that i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!