Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Home Work Define a function called price_hotel with one argument night as input. The hotel costs $140 per night. So the function price_hotel should return

Home Work

Define a function called price_hotel with one argument night as input. The hotel costs $140 per night. So the function price_hotel should return 140*night.

Define a function called Price_plain that takes a string, city, as input. The function should return a different price depending on the location, below are the valid destinations and their corresponding round-trip prices.

"Slemani": 190 "Hawler": 200 "Duhok": 150 "Karkuk": 130

After that define a function called price_rent_car with an argument called days. Calculate the cost of renting the car: Every day you rent the car costs $40. (cost = 40*days) if you rent the car for 7 or more days, you get $50 off your total (cost -=50). Alternatively (elif), if you rent the car for 3 or more days, you get $20 off your total. You cannot get both of the above discounts.

Return the cost. then define a function called total_trip which takes two arguments, city and day. Like the example above, have your function return the sum of calling the price_rent_car(day), price_hotel(day) and price_rent_plain(city) functions.

Modify your money_spend function definition. add a third argument, money_spend.

Modify what money_spend function does. Add the variable money_spend to the sum that it returns.

Input all of the data using User Input

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions