Question: You are required to create a small application that will calculate and display the fuel efficiency of a car in both metric and imperial units.

You are required to create a small application that will calculate and display the fuel efficiency of a car in both metric and imperial units. 1. The application should contain two functions: one to calculate the fuel efficiency in metric units and one to calculate the fuel efficiency in imperial units. 2. The application should: a. Calculate the car fuel efficiency in metric units where the distance driven is 500 kilometres and the fuel consumed is 52.28 litres. Display the fuel efficiency in metric units to two decimal places in the console. b. Calculate the car fuel efficiency in imperial units where the distance driven is 500 kilometres and the fuel consumed is 52.28 litres (metric to imperial conversion needed). Display the fuel efficiency in imperial units to two decimal places in the console. 3. You should not use global variables. The output of the application should be as follows: Your car has a fuel economy of 10.46 litres per hundred kilometres. Your car has a fuel economy of 3.70 gallons per hundred miles
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
