Question: loop termination by counter Loop Termination by Counter-Pseudocode: Write a pseudocode algorithm that calculates and prints the overall MPG (miles per gallon) for a series

loop termination by counter
 loop termination by counter Loop Termination by Counter-Pseudocode: Write a pseudocode

Loop Termination by Counter-Pseudocode: Write a pseudocode algorithm that calculates and prints the overall MPG (miles per gallon) for a series of miles and gallon user inputs. Use a loop to repeatedly ask the user to enter a miles value and a gallons value. Within the loop, accumulate miles and gallons separately. Use counter loop to ensure that the loop repeats three times. The algorithm should generate a display of prompts, inputs, and final output that looks like this (italicized values are user inputs): Sample session: Enter miles: 10 Enter gallons: 1 Enter miles: 20 Enter gallons: 2 Enter miles 10 Enter gallons: 2 Overall MPG = 8 Provide a graceful response if the total gallons equals zero

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!