Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Write a Python function, trip CostAndInfo(distanceKM, vehSpeedMPS, vehKPL, gasCostPerLiter, breakfastCostPer Day, lunchCostPerDay, dinnerCostPer Day, hotelCostPer Night) that takes as input: distanceKM: the trip's distance
1. Write a Python function, trip CostAndInfo(distanceKM, vehSpeedMPS, vehKPL, gasCostPerLiter, breakfastCostPer Day, lunchCostPerDay, dinnerCostPer Day, hotelCostPer Night) that takes as input: distanceKM: the trip's distance in kilometers (type: float) vehSpeedMPS: the vehicle's speed during the trip, in meters per second (type: float) vehKPL: the vehicle fuel efficiency in kilometers per liter (type: float) gasCostPerLiter: the price of one liter of gas in dollars (type: float) breakfastCost PerDay: cost of a day's breakfast in dollars (type: float) lunch CostPerDay: cost of a day's lunch in dollars (type: float) dinner CostPerDay: cost of a day's dinner in dollars (type: float) hotelCostPer Night: cost of one night in a hotel in dollars (type: float) and returns five values: the total cost of the trip in dollars (type: float) the gas cost of the trip in dollars (type: float) the number of hotel nights required (type: int) the numbers of lunches required (type: int) the food cost of the trip in dollars (type: float) 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 hotelCostPer Night. Important notes on cost: No hotel is needed on the day a trip ends. If a trip requires 8.0 hours. it does not require a hotel stay. Similarly, a trip of 16.0 hours requires one night of hotel, not two. No breakfast is needed on the first day of a trip. No dinner is needed on the final day of a trip. Lunch is needed only on days with more than 4.0 hours of travel
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