Algorithms


Pseudocode Example

Average Miles Per Gallon Algorithm

1. Get values for gallons_used, starting_mileage, and ending_mileage
2. Set the value of distance_driven to (ending_mileage - starting_mileage)
3. Set the value of average_miles_per_gallon to (distance_driven / gallons_used)
4. Print the value of average_miles_per_gallon
5. Stop

[Prev][TOC][Next]


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