Question: 2. Write a Python function, compare VehiclesFor Trip(distanceM, veh1Name, veh1 SpeedMPH, veh1MPG, veh2Name, veh2SpeedMPH, veh2MPG, gasCostPerGallon, breakfastCostPerDay, lunchCostPerDay, dinnerCostPerDay, hotelCostPer Night) that computes the cost

 2. Write a Python function, compare VehiclesFor Trip(distanceM, veh1Name, veh1 SpeedMPH,

2. Write a Python function, compare VehiclesFor Trip(distanceM, veh1Name, veh1 SpeedMPH, veh1MPG, veh2Name, veh2SpeedMPH, veh2MPG, gasCostPerGallon, breakfastCostPerDay, lunchCostPerDay, dinnerCostPerDay, hotelCostPer Night) 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: distanceM: the trip's distance in miles (type: float) veh1Name: a string representing the first vehicle (e.g. "Tesla") veh1 SpeedMPH: vehicle 1's speed in miles per hour (type: float) veh1MPG: vehicle 1's fuel efficiency in miles per gallon (type: float) veh2Name: a string representing the second vehicle (e.g. "BYD") veh2SpeedMPH: vehicle 2's speed in miles per hour (type: float) veh2MPG: vehicle 2's fuel efficiency in miles per gallon (type: float) gasCostPerGallon: the price of one gallon of gas in dollars (type: float) breakfastCostPerDay: cost of a day's breakfast in dollars (type: float) lunchCostPerDay: cost of a day's lunch in dollars (type: float) dinnerCostPerDay: cost of a day's dinner in dollars (type: float) hotelCostPer Night: cost of one night in a hotel in dollars (type: float) compare VehiclesFor Trip must make two calls to Qi's trip CostAndInfo function. Note: before calling trip CostAndInfo you should convert units using good accurate conversion factors for miles/kilometers and gallons/liters. 2. Write a Python function, compare VehiclesFor Trip(distanceM, veh1Name, veh1 SpeedMPH, veh1MPG, veh2Name, veh2SpeedMPH, veh2MPG, gasCostPerGallon, breakfastCostPerDay, lunchCostPerDay, dinnerCostPerDay, hotelCostPer Night) 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: distanceM: the trip's distance in miles (type: float) veh1Name: a string representing the first vehicle (e.g. "Tesla") veh1 SpeedMPH: vehicle 1's speed in miles per hour (type: float) veh1MPG: vehicle 1's fuel efficiency in miles per gallon (type: float) veh2Name: a string representing the second vehicle (e.g. "BYD") veh2SpeedMPH: vehicle 2's speed in miles per hour (type: float) veh2MPG: vehicle 2's fuel efficiency in miles per gallon (type: float) gasCostPerGallon: the price of one gallon of gas in dollars (type: float) breakfastCostPerDay: cost of a day's breakfast in dollars (type: float) lunchCostPerDay: cost of a day's lunch in dollars (type: float) dinnerCostPerDay: cost of a day's dinner in dollars (type: float) hotelCostPer Night: cost of one night in a hotel in dollars (type: float) compare VehiclesFor Trip must make two calls to Qi's trip CostAndInfo function. Note: before calling trip CostAndInfo you should convert units using good accurate conversion factors for miles/kilometers and gallons/liters

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!