(Gas Mileage) Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a C++ program that uses a while statement to input the miles driven and gallons used for each trip. The program should calculate and display the miles per gallon obtained for each trip and print the combined miles per gallon obtained for all tankfuls up to this point.
Enter miles driven (–1 to quit): 287Enter gallons used: 13MPG this trip: 22.076923Total MPG: 22.076923Enter miles driven (–1 to quit): 200Enter gallons used: 10MPG this trip: 20.000000Total MPG: 21.173913Enter the miles driven (–1 to quit): 120Enter gallons used: 5MPG this trip: 24.000000Total MPG: 21.678571Enter the miles used (–1 to quit): –1
a) Read the problem statement.
b) Formulate the algorithm using pseudocode and top-down, stepwise refinement.
c) Write a C++ program.
d) Test, debug and execute the C++ program.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.