Question: Please help..... A litter is 0.264179 gallons. Write a program that will read in the number of liters of gasoline consumed by the users car

Please help.....

A litter is 0.264179 gallons. Write a program that will read in the number of liters of gasoline consumed by the users 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.

Hint: Use a do-while loop to repeat the calculation, which asks user to repeat or not at the end of the loop.

Hint: The function should accept two double parameter values litter and mile values. It returns a double value of miles per gallon.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!