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.




Make up Assignment: Total marks [from 5 to 7] Note: Students who have missed their assignments till Assignment 3 or scored less than 14 marks out of 25 so far in all of the assignments [in total] are qualified to do this 'makeup assignment' to cover the loss if desired. This will replace any one of the missed assignment or the least scored assignment out of those submitted. Others falling out of the criteria will not be entertained. 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. https://eclass.yorku.ca/mod/assign/view.php?id=1428141
Answered 1 days AfterApr 04, 2022

Answer To: Question: Assume you have a road trip from city A to city B. Your vehicle consumes say 5.5...

Sathishkumar answered on Apr 06 2022
98 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