Question
Follow these steps: Create a Python file called expensevacation.py. Your task will be to calculate a users total holiday cost, which includes the plane cost,
Follow these steps: Create a Python file called expensevacation.py. Your task will be to calculate a users total holiday cost, which includes the plane cost, hotel cost, and car-rental cost. First, get the following user inputs: city_flight: The city they will be flying to. (You can create some options for them. Remember each city will have different flight costs.) num_nights: The number of nights they will be staying at a hotel rental_days: The number of days for which they will be hiring a car. Next, create the following four functions: hotel_cost: This function will take num_nights as an argument, and return a total cost for the hotel stay (you can choose the price per night charged at the hotel).
plane_cost: This function will take city_flight as an argument and return a cost for the flight. (Hint: use if/else if statements in the function to retrieve a price based on the chosen city.) car_rental: This function will take rental_days as an argument and return the total cost of the car rental (you can choose the daily rental cost.) holiday_cost: This function will take the three arguments hotel_cost, plane_cost, car_rental. Using these three arguments, you can call all three of the above functions with respective arguments and finally return a total cost for your holiday. Print out all the details about the holiday in a readable way. Try running your program with different combinations of input to show its compatibility with different options.
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