Here's an example Python program that meets the requirements:
# Global constants
CLASS_A_PRICE = 20.0
CLASS_B_PRICE = 15.0
CLASS_C_PRICE = 10.0
# Function to calculate and display total income generated from ticket sales
def showIncome(numClassA, numClassB, numClassC):
# Calculate income for each class
classA_income = numClassA * CLASS_A_PRICE
classB_income = numClassB * CLASS_B_PRICE
classC_income = numClassC * CLASS_C_PRICE
# Calculate total income
total_income = classA_income + classB_income + classC_income
# Display income for each class and total income
print("Income from Class A seats: $", format(classA_income, ".2f"), sep="")
print("Income from Class B seats: $", format(classB_income, ".2f"), sep="")
print("Income from Class C seats: $", format(classC_income, ".2f"), sep="")
print("Total income from ticket sales: $", format(total_income, ".2f"), sep="")
# Main program
def main():
# Local variables
numClassA = int(input("Enter the number of Class A seats sold: "))
numClassB = int(input("Enter the number of Class B seats sold: "))
numClassC = int(input("Enter the number of Class C seats sold: "))
# Call showIncome function
showIncome(numClassA, numClassB, numClassC)
# Call main program
main()
In this program, the global constants CLASS_A_PRICE, CLASS_B_PRICE, and CLASS_C_PRICE are declared to represent the prices of each class of seat. The showIncome function takes three parameters, which represent the number of seats sold for each class, and calculates the income for each class, as well as the total income from all three classes. The main function prompts the user to enter the number of seats sold for each class, and then calls the showIncome function to display the income generated from ticket sales. The format function is used to round the income to two decimal places.