Question: Python 3.0 via PyCharm Purpose: To write a function that performs a subtask and returns an answer. Degree of Difficulty: Easy A travel agent would

Python 3.0 via PyCharm

Python 3.0 via PyCharm Purpose: To write a function that performs a

Purpose: To write a function that performs a subtask and returns an answer. Degree of Difficulty: Easy A travel agent would like to compute the total cost of a trip that includes a flight, plus a number of nights at a hotel for a group of people. The agent is assuming double occupany, which means two will share each each night you could use the formula number-of-people // 2 number-of-people % 2 + Write a Python function trip cost that takes four parameters as input and returns the total cost of the trip. The four parameters should be the airfare in dollars, the room cost per night in dollars, the number of people, and the number of nights. Ask the user to input values for each of the function arguments from the console. You may assume that the user supplies valid input. Call the trip_cost function with the arguments you read from the console and output the its return value to the console. Sample Run Here is an example of how your program's console output might look. Green text was entered by the user blue text came from data returned by the function. Calculate Trip Cost Enter cost of flight (S) 1000 Enter cost of a double room per night:100.00 Enter the number of people 11 Enter the number of nights:7 The total cost of the trip for the group is $15200.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!