Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Summary In this lab, you complete a partially written Python program that computes hotel guest rates at Cornwalls Country Inn. The program is described in

Summary In this lab, you complete a partially written Python program that computes hotel guest rates at Cornwalls Country Inn. The program is described in Chapter 9, Exercise 11, in Programming Logic and Design. In this program, you should include a function named computeRate(). It should accept the number of days and calculate the rate at $99.99 per day. It should optionally include a code for a meal plan. If the code is A, three meals per day are included, and the price is $169.00 per day. If the code is C, breakfast is included, and the price is $112.00 per day. All other codes are invalid. The function returns the rate to the calling program where it is displayed. The main program asks the user for the number of days in a stay and whether meals should be included; then, based on the users response, the program either calls the function or prompts for a meal plan code and calls the function. Comments are included in the file to help you write the remainder of the program. Instructions Make sure the file Cornwall.py is selected and open. Write the Python statements as indicated by the comments. Execute the program by the clicking the Run button at the bottom of the screen.

# Cornwall.py - This program computes hotel guest rates.

# Input: Days in stay and meals included

# Output: Hotel guest rate

def computeRate(x,y)

if __name__ == '__main__':

rate = 0.00

dayString = input("How many days do you plan to stay? ")

days = int(dayString)

question = input("Do you want a meal plan? Y or N")

# Figure out which arguments to pass to the computeRate() function and

# then call the computeRate() function

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago