Write a modular python program for a Hotel at a vacation place to handle the guests charges as the person handling checkout makes their bill. There should be four functions to the program. Main should...

1 answer below »



Write a modular python program for a Hotel at a vacation place to handle the guests charges as the person handling checkout makes their bill. There should be four functions to the program. Main should call the Welcome Function, ask the user for the number of days the person stayed in the hotel with the NumberOfDays function, call the Checkout Function to get the amount of the bill, and the PrintBill function to add tax and print the final bill.













The Welcome Function should print a welcome message to the user with the name of your hotel.













The NumberOfDays function should ask how many days the guest stayed at your hotel, and it should return this number. Use validation to make numbers below one to be one, as the guest is going to stay at least one day.













The Checkout Function should take the number of days the guest is staying as a parameter. It should ask the daily rate and then have a Loop that goes to the number of days that were entered. For each day it add the daily rate and ask for additional charges (like attending a hotel party, have room service, or some other special added charge) and also add them to a total. The checkout function should return the total after the loop is done.













The PrintBill function should take the bill amount as a parameter and add the tax (7% of bill amount) and print the bill amount, tax and bill total for the user.













import functionLibrary #have to make this as another file in the web editor if you are using that. import random Count = 100 #global variable. It exists everywhere in the program def add_Numbers(personName, first, second): total = first + second print("Total of the two numbers for ", personName, " is ", total) x = 0 #local variable only exists here and goes away afterwards x = x + 1 print(x) global Count #this says hey python don't make another when you see this, use the global one Count = Count + 1 print(Count) def add_Numbers_and_Return(number1, number2, number3): total = number1 + number2 + number3 return total def main(): print("Main is running") add_Numbers("bob", 5, 7) add_Numbers("Lucy", 9, 10) pname = input("what is your name? ") n1 = int(input("enter number 1 ")) n2 = int(input("enter number 2 ")) add_Numbers(pname, n1, n2) print("----now a value returned and used in main----") total2 = add_Numbers_and_Return(1, 2, 3) print("Total of 3 numbers is passed back to main as ", total2) randomNumber1 = random.randint(1, 100) print("A random number in 1 to 100 range is ",randomNumber1 ) randomNumber2 = random.randint(1, 100) print("A random number in 1 to 100 range is ",randomNumber2 ) if __name__ == "__main__": main() #can be in a separate file. It's imported at the top #first = 5 #second = 10 #testvalue = functionLibrary.library_add_Numbers(first, second) #print("final function example is ", testvalue) #sample text webpageText = "Student Services Academic Resources Bookstore Library Services and General Information Student Life and Activities" print(webpageText) spacedMessage = "" webpageText = "Student Services Academic Resources Bookstore Library Services and General Information Student Life and Activities" print(webpageText) spacedMessage = "" for character in "Resources": spacedMessage = spacedMessage + character + " " print(spacedMessage) commaMessage = "" for character in "Resources": commaMessage = commaMessage + character + "," print(commaMessage) #by index print("------") print(spacedMessage[4]) #the s because its the 5th character..starts at 0 for this print(spacedMessage[0:4]) #slices work too word = input("Please Enter a search for our web page ") if (word in webpageText): print("This is on the page at character number ", webpageText.find(word)) else: print("It wasn't found") print( word.upper() ) #change to be upper case #safer if (word.upper() in webpageText.upper()): print("This is on the page") else: print("It wasn't found") count = 0 while count < 5:="" print("hello")="" count="count" +="" 1="" howmany="int(input("Please" enter="" the="" number="" of="" hellos="" to="" do="" again"))="" count="0" while="" count="">< howmany:="" print("hello")="" count="count" +="" 1="" #to="" do="" a="" total,="" set="" it="" to="" 0,="" each="" cycle="" of="" the="" loop="" add="" to="" it,="" use="" it="" after="" the="" loop="" #...lets="" save="" 100="" each="" week="" for="" 4="" weeks="" total="0" count="0" while="" count="">< 4: total = total + 100 count =count + 1 print("your total savings after 4 weeks is ", total) print() #to do a total, set it to 0, each cycle of the loop add to it, use it after the loop #...lets save 100 each week for 4 weeks total = 0 for weeknum in range(1, 5): print("adding 100 on week ", weeknum ) total = total + 100 print("your total savings after 4 weeks is ", total) for countdown in range(10, 0, -1): print(countdown) 4:="" total="total" +="" 100="" count="count" +="" 1="" print("your="" total="" savings="" after="" 4="" weeks="" is="" ",="" total)="" print()="" #to="" do="" a="" total,="" set="" it="" to="" 0,="" each="" cycle="" of="" the="" loop="" add="" to="" it,="" use="" it="" after="" the="" loop="" #...lets="" save="" 100="" each="" week="" for="" 4="" weeks="" total="0" for="" weeknum="" in="" range(1,="" 5):="" print("adding="" 100="" on="" week="" ",="" weeknum="" )="" total="total" +="" 100="" print("your="" total="" savings="" after="" 4="" weeks="" is="" ",="" total)="" for="" countdown="" in="" range(10,="" 0,="" -1):="">
Answered 2 days AfterDec 06, 2022

Answer To: Write a modular python program for a Hotel at a vacation place to handle the guests charges as the...

Priye answered on Dec 08 2022
31 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here