Question: I do not know what is wrong with the code. Can you please help? Assignment:Stadium Seating Write program that asks how many tickets for each
I do not know what is wrong with the code. Can you please help?
Assignment:Stadium Seating
- Write program that asks how many tickets for each class of seats were sold,then displays the amount of income generated from ticket sales.There are three seating categories at the stadium.Class A seats costs $20,Class B seats cost $15, and Class C seats cost $10. Assume the user will enter valid data (Integer/Float).
- Declare Global variables, Local variables and Global constants as needed in the program
- Write & call function ShowIncometo calculate and display total income generated from ticket sales for all three Class seating categories.
- The program should round the amount of income generated from ticket sales to a maximum of two decimal places.
My code:
def calculateClassATicketSales(classATicketsBought):
classASales = classATicketsBought * 20
return classASales
def calculateClassBTicketSales(classBTicketsBought):
classBSales = classBTicketsBought * 15
return classBSales
def calculateClassCTicketSales(classCTicketsBought):
classCSales = classCTicketsBought * 10
return classCSales
def calculateTotalSales( classASales, classBSales, classCSales):
showIncome = classASales + classBSales + classCSales
return totalSales
def printSalesAmount( classASales, classBSales, classCSales, totalSales):
print( "Income from Class A seats: $" + format(classASales, ',.2f') , \
"Income from Class B seats: $"+ format(classBSales, ',.2f') , \
"Income from Class C seats: $"+ format(classCSales, ',.2f') , \
"Total Income: $" + format(showIncome, ',.2.f'))
def main():
classATicketsBought = int(input(" Enter count of A seats: "))
classBTicketsBought = int(input(" Enter count of B seats: "))
classCTicketsBought = int(input(" Enter count of C seats: "))
classASales = calculateClassATicketSales(classATicketsBought)
classBSales = calculateClassBTicketSales(classBTicketsBought)
classCSales = caluculateClassCTicketSales(classCTicketsBought)
showIncome = calculateTotalSales(classASales, classBSales, classCSales)
printSalesAmount(classASales, classBSales, classCSales, totalSales)
main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
