60.1k views
2 votes
There are three seating categories at a stadium for a softball game, class a seats cost$15, class b seats costs $12, and class c seats costs $9. Design a modular program that asks how many tickets for each class of seats were sold, and then displays the amount of income generated from ticket sales.

User Sadik Ali
by
7.6k points

1 Answer

5 votes
def optionsIncome():
aSeats = int(input("How many Class A seats were sold? "))
bSeats = int(input("How many Class B seats were sold? "))
cSeats = int(input("How many Class C seats were sold? "))
totalIncome = aSeats * 15 + bSeats * 12 + cSeats * 9
print("The total income generated from ticket sales is $" + str(totalIncome) + ".")

optionsIncome()
User Sagar Gautam
by
6.7k points