I obviously don't want anyone to do my work for me here, but did I read this and do it correctly? The problem I had to do was:
A liter is 0.264179 gallons. Write a program that will read in the number of liters of gasoline consumed by the user’s car and the number of miles traveled by the car and will then output the number of miles per gallon the car delivered. Your program should allow the user to repeat this calculation as often as the user wishes. Define a function to compute the number of miles per gallon. Your program should use a globally defined constant for the number of liters per gallon.
I am a bit new to c++... but i don't see any mistakes in your math, or the code. The only issue i could see is this: "Define a function to compute the number of miles per gallon."
Undo what you just did, because you already had a globally defined const of liters per gallon: #define MPG 0.264179
The naming convention isn't quite correct but this is the global litters to gallons const.
Unless you want: constdouble lToG = 0.264179;//Liters to gallon conversion
Being above your main function.
Other than that, when testing redo, you'd want to test it against an integer value, not a character value.
1 != '1'
1==1
In your case, you'd want it to exit on 0 and repeat on 1:
Either: }while(redo == 0);
or }while(redo != 1);