Question: The final project involves creating a Python program that builds on the assignments for weeks 1 and 2. In addition to the house cleaning service

The final project involves creating a Python program that builds on the assignments for weeks 1 and 2. In addition to the house cleaning service from the previous assignments, the company will now offer yard service. Yard service involves mowing, edging and shrub pruning. The cost of the mowing depends upon the square footage of the yard, the cost of edging depends upon the linear footage of the yard's edges and the cost of shrub pruning depends upon the number of shrubs.

Your program should begin by asking the customer whether they are requesting house cleaning or yard service. If the user inputs an invalid choice, the user should be re-prompted until a valid choice is entered. Depending upon the choice the program should then prompt the user for the information needed to determine the cost of the service.

Seniors receive a discount on both services. You decide the discount amount, which can be either a percentage or a fixed dollar amount. You also decide how to prompt the user, either by requesting the customer's age or asking whether the customer is a senior?

The output of your program should be the cost of the requested service.

At a minimum, your program should have one function to calculate the house cleaning cost, another to calculate the yard service cost and a third to determine the discount.

Your program should include comments for the major steps of your code. You should already have these in your design/pseudocode. Also document the values you chose as the cost of house cleaning, which include the cutoffs for the three house sizes, the cost for each size and the surcharge for a more complete cleaning. In addition document the cost of square foot for moving, the cost per linear foot for edging and the cost per shrub for pruning. Finally you should document any constants involved in determining the senior discount.

IF YOU NEED THE REQUIREMENT FOR THE FIRST AND SECOND WEEK ASSIGNMEN....

**** Week 1 assignment requirement***

Write a Python program to compute the cost of house cleaning. Your program should prompt the user for the number of rooms in the house and the type of cleaning (eg. Floors, Windows, Bathrooms, Dusting, etc.). Your program must offer at least two types of cleaning and the price is different for each type. You should decide on the choices to offer and the different prices of each type of cleaning. The cost should be based on whether the house has a small number of rooms, a medium number or a large number and the type of cleaning. You should decide on the cutoffs for what constitutes a small, medium and large number of rooms. Your program should output the cost of the house cleaning based on the number of rooms and the type of cleaning.

Code:

customer_name=input('Please enter your name:') customer_addr=input('Please enter the address for the service:') print(' ')

#Displays name and address print('Hello',customer_name+'.') print('Service Address:',customer_addr+'. ')

#Displays cleaning services offered print('''Please choose from the cleaning services below: 1. Deep Carpet Cleaning ~ $150 2. Windows Cleaning ~ $70 3. Ceiling Cleaning ~ $180''') service_type=int(input('Enter service number(1, 2, or 3): '))

#Prompt user to choose a service size #Option 1 is small number of room(s) #Option 2 is medium number of rooms #Option 3 is large number of rooms print('''Please choose from the service size below: 1. One to Two rooms 2. Two to Three rooms 3. Three or more''') service_size=input('Enter service size:(Choose 1, 2, or 3): ')

#Service cleaning rates(In Dollars) carpet_cleaning=150 windows_cleaning=70 ceiling_cleaning=180

#Computes the total cost of service carpet_cleaning_cost=carpet_cleaning*int(service_size) windows_cleaning_cost=windows_cleaning*int(service_size) ceiling_cleaning_cost=ceiling_cleaning*int(service_size) print('=========================================================') print('Service Address:',customer_addr+'.')

if service_size=='1' and service_type==1: print('Small number of room(s). Total invoce for this service is $',carpet_cleaning_cost) elif service_size=='1' and service_type==2: print('Small number of room(s). Total invoce for this service is $',windows_cleaning_cost) elif service_size=='1' and service_type==3: print('Small number of room(s). Total invoce for this service is $',ceiling_cleaning_cost) elif service_size=='2' and service_type==1: print('Medium number of rooms. Total invoce for this service is $',carpet_cleaning_cost) elif service_size=='2' and service_type==2: print('Medium number of rooms. Total invoce for this service is $',windows_cleaning_cost) elif service_size=='2' and service_type==3: print('Medium number of rooms. Total invoce for this service is $',ceiling_cleaning_cost) elif service_size=='3' and service_type==1: print('Large number rooms. Total invoce for this service is $',carpet_cleaning_cost) elif service_size=='3' and service_type==2: print('Large number rooms. Total invoce for this service is $',windows_cleaning_cost) elif service_size=='3' and service_type==3: print('Large number rooms. Total invoce for this service is $',ceiling_cleaning_cost) else: print('Error. Please check Service Type & Service Size entered. Restart the program.') #Displays error message if any other number apart from 1,2, and 3 is entered for service type & size.

********Week 2 assignment requirement******

Rewrite the Python program you wrote for your assignment last week to use a function. All the requirements from last week still apply. The function should accept the number of rooms, and the type of cleaning as parameters and should return the cost of of the house cleaning. The main program should prompt the user for the number of rooms in the house and whether the cleaning should be a light cleaning or a more complete one, it should call the function that computes the cost and should output the value the function returns.

Code:

def invoice(service_type, service_size, cleaning_surcharge_prompt):

#Service cleaning rates(In Dollars) if service_type == 1: carpet_cleaning = 150 * service_size windows_cleaning = 70 * service_size ceiling_cleaning = 180 * service_size

elif service_type == 2: carpet_cleaning = 150 * service_size windows_cleaning = 70 * service_size ceiling_cleaning = 180 * service_size

elif service_type == 3: carpet_cleaning = 150 * service_size windows_cleaning = 70 * service_size ceiling_cleaning = 180 * service_size if cleaning_surcharge_prompt == 1: #Adds a surcharge price cleaning_surcharge = 100 #Surcharge in dollars surcharge_message = ", including a $" + str(cleaning_surcharge) + " surcharge for the thorough cleaning." else: cleaning_surcharge = 0 surcharge_message = ""

if service_size == 1 and service_type == 1: cleaning_cost = carpet_cleaning + cleaning_surcharge completion_message = ('Small number of room(s). Total invoice for this service is $')

elif service_size == 1 and service_type == 2: cleaning_cost = windows_cleaning + cleaning_surcharge completion_message = ('Small number of room(s). Total invoice for this service is $')

elif service_size == 1 and service_type == 3: cleaning_cost = ceiling_cleaning + cleaning_surcharge completion_message = ('Small number of room(s). Total invoice for this service is $')

elif service_size == 2 and service_type == 1: cleaning_cost = carpet_cleaning + cleaning_surcharge completion_message = ('Medium number of room(s). Total invoice for this service is $')

elif service_size == 2 and service_type == 2: cleaning_cost = windows_cleaning + cleaning_surcharge completion_message = ('Medium number of room(s). Total invoice for this service is $')

elif service_size == 2 and service_type == 3: cleaning_cost = ceiling_cleaning + cleaning_surcharge completion_message = ('Medium number of room(s). Total invoice for this service is $')

elif service_size == 3 and service_type == 1: cleaning_cost = carpet_cleaning + cleaning_surcharge completion_message = ('Large number of room(s). Total invoice for this service is $')

elif service_size == 3 and service_type == 2: cleaning_cost = windows_cleaning + cleaning_surcharge completion_message = ('Large number of room(s). Total invoice for this service is $')

elif service_size == 3 and service_type == 3: cleaning_cost = ceiling_cleaning + cleaning_surcharge completion_message = ('Large number of room(s). Total invoice for this service is $') return completion_message, cleaning_cost, surcharge_message

#Prompt the user to enter their name & address customer_name=input('Please enter your name:') customer_addr=input('Please enter the address for the service:') print(' ')

#Displays name and address print('Hello',customer_name+'.') #print('Service Address:',customer_addr+'. ')

#Displays cleaning services offered & ask user to enter service type by corresponding number print('''Please choose from the cleaning services below: 1. Deep Carpet Cleaning ~ $180 2. Windows Cleaning ~ $120 3. Ceiling Cleaning ~ $150''') service_type=int(input('Enter service number(1, 2, or 3): '))

#Prompt user to choose a service size #Option 1 is small number of room(s) #Option 2 is medium number of rooms #Option 3 is large number of rooms print('''Please choose from the service size below: 1. One to Two rooms 2. Two to Three rooms 3. Three or more''') service_size=input('Enter service size:(Choose 1, 2, or 3): ')

cleaning_surcharge_prompt = input(" If significant cleaning required, press 1. Otherwise, press 2. ")

print(' Service Address:',customer_addr+'.')

completion_message, cleaning_cost, surcharge_message = invoice(int(service_type), int(service_size), int(cleaning_surcharge_prompt)) print(str(completion_message) + str(cleaning_cost) + str(surcharge_message))

THANKS IN ADVANCE!

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 General Management Questions!