I am writing a program that calculates MPG at each fill up of a trip then when the user enters an empty string the loop quits and displays MPG of each fill up and total MPG of the full trip. I have created a algorithm which is shown below. Please give your input. Thanks.
Algorithm:
Do while tripmiles not equal to a blank line
    Get initial odometer miles from user and assign to tripA
    get final odometer miles from user and assign to tripB
    subtract tripB from tripA and assign the value to leg_1
    get gallons from user and assign the value to mygals
    divide leg_1 by mygals and assign value to leg_mpgs
    add each leg_mpgs and divide by total legs, assign to mytotalmpg 
Display each leg_mpg and mytotalmpg to screen
guys please keep in mind that i'm not writing code here. Its just an Algorithm. Thanks again
 
     
    