Question: Assume you have a road trip from city A to city B. Your vehicle consumes say 5.5 lit/100km. 1. Define a function mpg that converts the customary miles/gallon into litres/100km of fuel...

1 answer below »


Question: Assume you have a road trip from city A to city B. Your vehicle consumes say 5.5 lit/100km.

1. Define a function mpg that converts the customary miles/gallon into litres/100km of fuel consumption.

2. Add an optional parameter to differentiate b/w Imperial gallon to litres and US gallon to litres (with US gallon as a default). Show your converted scale from mpg into lit/100km.

3. Define a second function called dollar. Given the fuel cost/lit (Google the current rate of fuel from your nearby Gas station), calculate and show the total cost for the trip.

4. Present your results by taking user based inputs arguments such as vehicle mileage , current fuel rate and distance in km.

Submit your ‘code file’ in a PDF format with the associated inputs and outputs in readable screenshots . Name and upload your file as make_up_your_name.pdf.

Answered 1 days AfterApr 04, 2022

Solution

Sathishkumar answered on Apr 06 2022
11 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here