Question: Write a program that will read the number of LITERS of gasoline consumed by the user's car, and the number of MILES traveled by the

Write a program that will read the number of LITERS of gasoline consumed by the user's car, and the number of MILES traveled by the car.

The program will then output the number of MILES PER GALLON that the car delivered.

Your program should allow the user to REPEAT this calculation.

Define a function to compute the number of miles per gallon.

double mpg(double miles, double liters);

Take input data for TWO cars and output the number of miles per gallon delivered by EACH car.
Your program must announce which car has the better fuel efficiency.

Hint: LITER =  0.264179 GALON.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

def mpgmiles liters LITERTOGALLONCONVERSION 0264179 return miles liters LITERTOGALLONC... View full answer

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 Computer Network Questions!