Zebra0.com

algorithms mileageMPG Pseudocode

MPG Pseudocode

Gas Mileage Pseudo-code

Pseudo-code for the MPG problem:
Input startOdometer
Input finalOdometer
Input gallons
distance = finalOdometer – startOdometer
mpg = distance/gallons
Output mpg

Note the order of the statements. For the most part the statements
must be in that order.

We can now write the program