Answer :
Answer:
Replace
''' Type your code here '''
with the following lines of code:
price1 = services[service_choice1]
price2 = 0
if not (service_choice2 == "-"):
price2 = services[service_choice2]
total = base_wash + price1 + price2
print("Zycar Wash")
print("Base car wash: $"+str(base_wash))
print(service_choice1+str(": $")+str(price1))
print(service_choice2+str(": $")+str(price2))
print("Total price: $"+str(total))
Explanation:
The complete program with explanation is as follows:
The italicized lines were originally part of the question
services = { 'Air freshener' : 1 , 'Rain repellent': 2, 'Tire shine' : 2, 'Wax' : 3, 'Vacuum' : 5 }
base_wash = 10
total = 0
service_choice1 = input()
service_choice2 = input()
This line gets the price of service choice 1
price1 = services[service_choice1]
This line initialzes price of service choice 2 to 0
price2 = 0
If an additional service (i.e. service choice 2) is selected
if not (service_choice2 == "-"):
This line gets the price of service choice 2
price2 = services[service_choice2]
This calculates the total price
total = base_wash + price1 + price2
This prints the header
print("Zycar Wash")
This prints the base car wash
print("Base car wash: $"+str(base_wash))
This prints the service choice 1
print(service_choice1+str(": $")+str(price1))
This prints the service choice 2
print(service_choice2+str(": $")+str(price2))
This prints the total
print("Total price: $"+str(total))