Algorithms


Alternative Pseudocode

Average Miles Per Gallon Algorithm (alternative)

1. read gallons_used, starting_mileage, ending_mileage
2. distance_driven <- ending_mileage - starting_mileage
3. average_miles_per_gallon <- distance_driven ÷ gallons_used
4. write average_miles_per_gallon
5. stop

[Prev][TOC][Next]


CS1104 Main Page
Last Updated 01/05/2000
© L.Heath, 2000