I am a beginner in C++. I have already made the part to calculate the mpg, but it only does it once. I have many reciepts i want to calcualte in one go and i want the average mpg to show when i am done, what will i have to do?
I am a beginner in C++. I have already made the part to calculate the mpg, but it only does it once. I have many reciepts i want to calcualte in one go and i want the average mpg to show when i am done, what will i have to do?
what's "the mpg"? I have no idea what you're talking about...
mpg is miles per gallon on a car
Use a loop to keep getting input, incrementing the number of inputs inputted, and keep a tally of total miles and total gallons. Then, just divide total miles by total gallons and you're done.
-Govtcheez
[email protected]