Question: C++ Problem: Declare a structure with the following fields: car_id (an int between 1 and 1000) miles_driven (an int) gallons_used (an int) Write a program

C++ Problem:

Declare a structure with the following fields:

car_id (an int between 1 and 1000)

miles_driven (an int)

gallons_used (an int)

Write a program that accepts the total number of cars and then reads the info for each car and stores them in an array

After reading them all in, it prints out a listing with each cars ID followed by the miles per gallon (as a float)

At the very end, it also prints out the total average miles per gallon over the entire fleet of cars given.

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!