Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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, 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started