Question: A) Declare a structure data type with the following fields: Car Id (an integer between 1 and 1000), Miles Driven (integer), Gallons Used (integer). B)

A) Declare a structure data type with the following fields: Car Id (an integer between 1 and 1000), Miles Driven (integer), Gallons Used (integer).

B) Using the data type declared in (A), writea C++ program that accepts the total number of cars and then reads them in and stores them in an array. For example

5

25 1450 62

36 3240 136

44 1792 76

52 2360 105

68 2114 67

C) After the data has been entered, the program should create a printout listing each car number and the cars miles per gallon (as a float). At the end of the printout, include also the average miles per gallon (as a float) for the entire fleet of cars.

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!