Question: Using c++ object oriented programming: Create a function that writes to a file named cars.txt the information of 8 cars. Ask the user for the
Using c++ object oriented programming:
-
Create a function that writes to a file named cars.txt the information of 8 cars. Ask the user for the plate number, number of miles driven and number of gas used in each car and write it to the file.
-
Create a function that reads the file and stores the miles driven and gallons used to two different arrays.
-
Create a function that computes the total miles driven, total gallons used and average miles per gallon for all the cars.
-
Implement all function inside the main program and all the computed values should be displayed appropriately.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
