Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. stadium.py (30 points) There are three seating categories at a stadium. Class A seats cost $20, class B seats cost $15, and Class C

2. stadium.py (30 points) There are three seating categories at a stadium. Class A seats cost $20, class B seats cost $15, and Class C seats cost $10. Write a program that asks how many tickets are each class of seats were sold, then display the amount of income generated from ticket sales. Hints: Define main (): Declare local variables under main() program. income_Aseats = 0.0, income_Bseats = 0.0, income_Cseats = 0.0, category = "", num_tickets = 0, seating_price = 0.0, need_more_tickets = 'Y' Write while loop, to get the user input and price based on the category Calculate income Verify if the Category is A or B or C . //with If , elif statements Prompt the User if they need more tickets Write the showIncome function to accepts the income from class A, B, and C seats and displays the total income. Calculate total income. i.e. total_income = income_Aseats + income_Bseats + income_Cseats Display total income Write getSeatingPrice function to get seat category. ie. if elif for A, B, and C Write getUserInput function to prompt the User for getting the Category and number of tickets return category, num_tickets to the main function from where they have been called Sample Output: Welcome to the Stadium Seating Application Category A - $20 Category B - $15 Category C - $10 Enter the category (A, B or C): A Enter the number of ticktes required: 10 Do you need more tickets? press Y to continue or press N to quit: N Income from class A seats: $200.00 Income from class B seats: $0.00 Income from class C seats: $0.00 Total income: $200.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions