This week's assignment involves rewriting the Python program youwrote for your assignment last week to use a function. All therequirements from last week still apply. The function should acceptthe number of rooms, and the type of cleaning as parameters andshould return the cost of of the house cleaning. The main programshould prompt the user for the number of rooms in the house andwhether the cleaning should be a light cleaning or a more completeone, it should call the function that computes the cost and shouldoutput the value the function returns.
If your program from last week contained any bugs, you shouldcorrect them in this submission.
Your program should include Header comments (what the programdoes) and in-line comments (the major design steps). Documentthe values you chose as the cutoffs for the three housesizes, the cost for each size and the surcharge for a more completecleaning in your comments as well.
How do I include this new information in the previousassignment?
Lewis Brittany Assignment 2 cleaning svc.py - File Edit Format Run Options Window Help +Greet the user and describe what the program does print("Welcome to Simply Clean! We will help you calculate the cost of cleaning your house based on the cleaning service and size of the house.") 43et the cost of cleaning service (cost per room) floors = 15 windows 5 #Prompt the user for the type of cleaning service they need print("Please select the type of cleaning service needed.") print("\nFor floors, please select option 1.") print("For windows, please select option 2.") service int (input()) print("Thank you for this information.") +Prompt the user for the number of rooms rooms -int (input("\nPlease enter the number of rooms you wish to have cleaned.")) *Set values for house size it (rooms<-4): housesize="small" elif (rooms <-7 and rooms >-5): housesize 'medium' C/Users/bsped/Documents/CMIS 102/Lewis Brittany Assignment 2 cleaning svc.py (3.10.5) housesize 'large' print ("\nYour house is considered", housesize) print("We will determine your total below."). 4Calculate the price to clean the house if service == 1: price (floors * rooms) elif service - 2: price (windows* rooms) 4Display the price to clean the house print("\nThe cost to clean your house is", price) print ("\nBrittany Lewis") print ("CMIS 102 6981") print ("7/5/2022") 72°F Mostly cloudy ē 40 0 Ln: 38 Col: 10 7:28 AM 7/5/2022 >
This week's assignment involves rewriting the Python program you wrote for your assignment last week to use a function.
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am