# Stadium Seating

# Constants represent the price of seat of each class.
CLASS_A_SEAT = 20
CLASS_B_SEAT = 15
CLASS_C_SEAT = 10

# Defining the main function.
def main():
    # Getting the number of seats of each class
    a_class_seats = get_seats("A")
    b_class_seats = get_seats("B")
    c_class_seats = get_seats("C")

    # Calculating the total income.
    total_income = seat_income(a_class_seats, b_class_seats, c_class_seats)

    # Displaying the output.
    print("The total income generated by ticket sales is $", format(total_income, ',.2f'), sep = '')

# This fucntion gets the number of seat and returns it, takes the seat type as argument.
def get_seats(seat_type):
    seats = int(input("Enter the number of " + seat_type + " seats: "))

    # Input Validation.
    while seats < 0:
        print("ERROR!, seats cannot be negative.")
        seats = int(input("Enter the number of " + seat_type + " seats: "))
    
    return seats

# This function calculates the total income generated from the ticket sales and returns it.
def seat_income(a_class, b_class, c_class):
    total_income = a_class * CLASS_A_SEAT
    total_income += b_class * CLASS_B_SEAT
    total_income += c_class * CLASS_C_SEAT

    return total_income

# Calling the main function.
main()