Question
Hi, I need help troubleshooting this program, the error message syas that my program has produced no output! #Implementation of automativeService class class automativeService(): #Implementation
Hi, I need help troubleshooting this program, the error message syas that my program has produced no output!
#Implementation of automativeService class
class automativeService():
#Implementation of displayInvoice method
def displayInvoice(self):
#Display statements
print()
print("Davy's auto shop services")
print("Oil Change -- $35")
print("Tire rotation -- $19")
print("Car wash -- $7")
print("Car wax -- $12")
print()
#Get the input
print()
service1 = input("Select first service:\t")
service2 = input("Select second service:\t")
#Declare the dictionary and initailize it
dic ={"Oil Change":"35","Tire rotation":"19","Car wash":"7","Car wax":"12"}
#Declare the total and assign zero
total = 0
#Display statements
print()
print("Davy's auto shop invoice")
print()
#Iterate the dictionary values
for key,value in dic.items():
if(service1 == key):
print ("Service 1: ",key,dic[key])
total = total + int(dic[key])
if(service2 == key):
print("Service 2: ",key,dic[key])
total = total + int(dic[key])
#if the service2 value is - then it display No service
if(service2 == "-"):
print("Service 2: ","No service")
print()
#Display the total
print("Total :$",total)
print()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started