Question: Using (VS17Express) Write a C++ program to evaluate the fuel consumption of a car. The mileage at the start and end of the journey should

Using (VS17Express)

Write a C++ program to evaluate the fuel consumption of a car.

The mileage at the start and end of the journey should be read, and also the fuel level in the tank at the start and end of the journey.

Calculate fuel used, miles travelled, and hence the overall fuel consumption in miles travelled per gallon of fuel.

In many countries using the metric system, car fuel consumptions are measured in liters of fuel required to travel 100 kilometers.

Modify your solution so that the output now specifies the distance travelled in kilometers as well as in miles, and the fuel consumed in liters as well as in gallons, and the consumption in liters per 100 kilometers as well as in miles per gallon.

Use const for the conversion factors between miles and kilometers, and gallons and liters.

Design:

Your output should be formatted to 2 decimal places.

1mile = 1.609kms

1gallon = 3.785liters

The picture above is how your output should look.

Your program should ask the questions in the same order. Starting mileage first, ending mileage, fuel at start, and fuel at end.

It's not specified how/if/when you should round your answers. It's only specified that your output should be formatted to two decimal places.

Document your assumption as comments in your code. Thank you.

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!