Question

In Python There are 3 seating categories at a stadium. Class A seats cost $20, class...

In Python

There are 3 seating categories at a stadium. Class A seats cost $20, class B cost $15, and class C $10. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from tickets sales. This program should have main, calcIncome, and showIncome functions. Main function should get number of seats sold for each category and sent to calcIncome. calcIncome calculates income for each category, the return to the main function and those value should be sent to showIncome function. showIncome calculates total income from tickets sales, display income generated from each category and display total income generated.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def calcIncome(n,c):

if c=="A":

return n * 20

if c=="B":

return n * 15

if c=="C":

return n * 10

def showIncome(a,b,c):

total=a+b+c

print("Total income for class A tickets : $",a)

print("Total income for class B tickets : $",b)

print("Total income for class C tickets : $",c)

print("Total income : $",total)

def main():

a=int(input("Enter tickets sold for class A: "))

b=int(input("Enter tickets sold for class B: "))

c=int(input("Enter tickets sold for class C: "))

aIncome=calcIncome(a,"A")

bIncome=calcIncome(b,"B")

cIncome=calcIncome(c,"C")

showIncome(aIncome,bIncome,cIncome)

main()

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
In Python There are 3 seating categories at a stadium. Class A seats cost $20, class...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • There are three seating categories at a stadium. For a softball game, Class A seats cost...

    There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. 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. Format your dollar amount in fixed-point notation, with two decimal places of precision, and be sure the decimal point is always displayed. Using the following test data:...

  • There are three seating categories at a stadium. For a softball game, Class A seats cost...

    There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. 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. Format your dollar amount in a fixed-point notation with two decimal points and make sure the decimal point is always displayed. (Write for C++ code ony please)

  • Can anyone help me with this? Stadium Seating There are three seating categories at the Broward...

    Can anyone help me with this? Stadium Seating There are three seating categories at the Broward College Stadium. For a softball game, student tickets cost $9.00, senior tickets cost $12.00 and general tickets cost $15.00. Write a program that asks how many tickets for each class of seats were sold. Then display the total number of tickets sold, the amount of income generated from each class and the total ticket sales. For the program: Create pseudocode as a .txt file....

  • How would you code this in Python3? Instructions from your teacher: There are three seating categories...

    How would you code this in Python3? Instructions from your teacher: 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 for each class of seats were sold, then displays the amount of income generated from ticket sales.

  • create Stadium Seating visual basic

    There are three seating categories at an athletic stadium. For a baseball game, Class A seats cost $15 each, Class B seats cost $12 each, and Class C seats cost $9each. Create an application that allows the user to enter the number of tickets sold for each class. The application should be able to display the amount of incomegenerated from each class of ticket sales and the total revenue generated.Use the following test data to determine if the application is...

  • Theater Seating Revenue with Input Validation

    A dramatic theater has three seating sections, and it charges the following prices for tickets in each section:Section A seats cost $20 each, section B seatscost $15 each, and section C seats cost $10 each.The theater has 300 seats in section A, 500 seats in section B, and 200 seats in section C.Design aprogram that asks for the number of tickets sold in each section and then displays the amount of income generated from ticket sales.The program should validatethe numbers...

  • C++ : Write a program to manage the seating for an event. Let us say we...

    C++ : Write a program to manage the seating for an event. Let us say we have 100 regular seats and 50 premium seats. Regular seats are $10 each and premium seats are $15 each. As customers walk in, ask them how many tickets, and if they want either regular or premium seating. Display the total cost based on the responses. Keep track of the tickets sold and ensure that you don't sell any tickets beyond the capacity. Enter 0...

  • The language is C++ for visual studio express 2013 for windows create a TicketManager class and...

    The language is C++ for visual studio express 2013 for windows create a TicketManager class and a program that uses the class to sell tickets for a performance at a theater. Here are all the specs. This is an intense program, please follow all instructions carefully. -I am only creating the client program that uses the class and all it's functions -The client program is a menu-driven program that provides the user with box office options for a theater and...

  • A bus has 28 seats, arranged in 7 rows and 4 columns: This seating arrangement is...

    A bus has 28 seats, arranged in 7 rows and 4 columns: This seating arrangement is mapped, row-wise, to a 1D-array of size 28: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Implement a well-structured C program to enable a user to make and cancel seat reservations for the bus. The program uses a text-file seats.txt to store the reservation...

  • 1 Stadium seating The Golden One Center is a monopoly supplier of Sacramento Kings tickets. Suppose...

    1 Stadium seating The Golden One Center is a monopoly supplier of Sacramento Kings tickets. Suppose that demand to see the Kings is given by p(Q) - into the stadium equals 1. For simplicity, assume that there are no fixed costs 1 vQ The marginal cost of letting another person . a. Write Golden One's profits in terms of Q. Simplify your answer as much as possible. (Hint: if the marginal cost is 1 and there are no fixed costs,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT