Chapter 4: Problem 13
Perform each of these steps: 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. Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording miles driven and gallons used for each tankful. Develop a \(C++\) program that uses a while statement to input the miles driven and gallons used for each tankful. The program should calculate and display the miles per gallon obtained for each tankful and print the combined miles per gallon obtained for all tankfuls up to this point.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.