Hey everyone. I am supposed to create a program that will input the miles driven and gallons used for each tank full of gas. program has to calculate and display the miler per gallon obtained for each tankful and print the combined miles per gallon for all tank fulls up to that point.
I am trying to figure out how i would actually go about doing this. i have a rough idea but i know this is not going to work. i have been trying to figure it out for ever, anybody care to point me in the right direction? here is my pseudocode so far...
Initialize mpg to 0
initialize tank to 1
Int miles
Int gallons
While not sentinel value
Prompt the user to enter the miles driven
Prompt user to enter total gallons used
Miles++
Gallons++
Mpg=miles/gallons
Mpg++
Print the total mpg