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
Get step-by-step solutions from verified subject matter experts
