Question: C + + a . Declare a structure data type with the following fields: Car id ( integer ) , Miles Driven ( integer )

C++
a. Declare a structure data type with the following fields:
Car id (integer), Miles Driven (integer), Gallons Used (integer).
b. Using the data type declared for in (a), write a C++ program that accepts the total number of cars (assume that there are at most 1000 cars) and then reads them in.
For example
5
25145062
363240136
44179276
522360105
68211467
c. After the data has been entered, the program should print each car's id and the car's mpg(miles per gallon, as a float). At the end of this, print out also the average mpg for the entire fleet of cars followed by the ids of the cars that have above average mpg.
 C++ a. Declare a structure data type with the following fields:

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!