Homework 1
CS2110 Programming for Informatics
Due Thursday, Feb. 4, 2021, by 10:00pm
6 points

Note: I strongly suggest completing DS Assignment 1 (will be published Thursday morning, Jan. 28) before starting HW1. The small problems in DS1 will be helpful in HW1. Hints and an outline for completing HW1 will also be given in lecture.

1. Write a Python function, tripCostData(distanceKM, vehSpeedMPS, vehKPL, gasCostPerLiter, hotelCostPerNight, breakfastCostPerDay, lunchCostPerDay, dinnerCostPerDay) that takes as input:

and returns five values (in this order): Presume that you can only drive 8 hours per day. So, if a trip requires 15.25 hours, it will require a one-night hotel stay at an additional cost (beyond gas and food costs) equal to hotelCostPerNight.

Important notes on cost: 2. Write a Python function, compareVehiclesForTrip(distanceM, veh1Name, veh1SpeedMPH, veh1MPG, veh2Name, veh2SpeedMPH, veh2MPG, gasCostPerGallon, breakfastCostPerDay, lunchCostPerDay, dinnerCostPerDay, hotelCostPerNight) that computes the cost and other information of a trip for two different vehicles, and then prints information about the cost along a recommendation of vehicle should be used to save money. (Note: if trip cost is the same for both vehicles, say something appropriate).

The function's parameters are: compareVehiclesForTrip must make two calls to Q1's tripCostData function.
Note: before calling tripCostData you should convert units using good accurate conversion factors for miles/kilometers and gallons/liters.

For example,
  >>> compareVehiclesForTrip(1000.0, "Bugatti", 100.0, 1.0, "Vespa", 27.0, 100.0, 2.10, 11.0, 23.0, 55.0, 6.50)
1000.0 miles in vehicle 'Bugatti' will cost $2195.50, including:
	 $6.50 for 1 hotel nights, $2100.00 for gas, and $89.00 for food (including 1 lunch)
1000.0 miles in vehicle 'Vespa' will cost $426.00, including:
	 $26.00 for 4 hotel nights, $21.00 for gas, and $379.00 for food (including 5 lunches)
To save money, use 'Vespa'

>>> 
3. Write function testQ1() that makes at least five calls to tripCostData(...) with different arguments.
4. Write function testQ2() that makes at least five calls to compareVehiclesForTrip(...) with different arguments.

Submit to ICON one python file containing all four function definitions. The file must not include any code (except "import math") that is not part of a function definition.
Make sure your functions are named exactly (including upper/lower case usage) as in the specification, with the same set of parameters, in the same order .