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 takinguser based inputsarguments 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.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here