Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

Name and briefly explain five different research methodologies.

Answered: 1 week ago

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago

Question

What roles have these individuals played in your life?

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago