213k views
1 vote
Write a 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. Console Output:

User Tuyen Cao
by
3.9k points

1 Answer

1 vote

Answer:

# prompt the user to enter number of ticket for class A

classAticket = int(input("Please enter number of ticket for class A"))

# prompt the user to enter number of ticket for class B

classBticket = int(input("Please enter number of ticket for class B"))

# prompt the user to enter number of ticket for class C

classCticket = int(input("Please enter number of ticket for class C"))

# the total amount for ticket is calculated

totalAmount = (classAticket * 20) + (classBticket * 15) + (classCticket * 10)

# the total amount is printed

print("The total amount for ticket is $", totalAmount, sep="")

Step-by-step explanation:

The program is written in Python and well commented.

User Patan
by
3.8k points