PYTHON- A movie theater only keeps a percentage of the revenue earned from ticke
ID: 3593049 • Letter: P
Question
PYTHON-
A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie distributor. Write a program, in python, that calculates a theater’s gross and net box office profit for a night. The program should ask for how many adult and child tickets were sold. Net box office is 20% of Gross. Distributor would be 80% of gross. (The price of an adult ticket is $10.00 and a child’s ticket is $6.00.) It should display a report similar to:
Adult Tickets Sold: 382
Child Tickets Sold: 127
Gross Box Office Profit: $4582.00
Net Box Office Profit: $916.40
Amount Paid to Distributor: $3665.60
Create two functions for input, one for 'adult tickets sold' and one for 'child tickets sold'
Create a function for calculating gross
Create a function for calculating net
Create a function for calculating distributor
Create a function for output which contains 5 print lines
Explanation / Answer
'''
PYTHON-
A movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie distributor. Write a program, in python, that calculates a theater’s gross and net box office profit for a night. The program should ask for how many adult and child tickets were sold. Net box office is 20% of Gross. Distributor would be 80% of gross. (The price of an adult ticket is $10.00 and a child’s ticket is $6.00.) It should display a report similar to:
Adult Tickets Sold: 382
Child Tickets Sold: 127
Gross Box Office Profit: $4582.00
Net Box Office Profit: $916.40
Amount Paid to Distributor: $3665.60
Create two functions for input, one for 'adult tickets sold' and one for 'child tickets sold'
Create a function for calculating gross
Create a function for calculating net
Create a function for calculating distributor
Create a function for output which contains 5 print lines
'''
def get_adult_tickets_sold():
return int(input("Adult Tickets Sold: "))
def get_child_ticket_sold():
return int(input("Child Tickets Sold: "))
def calculate_gross_profit(adult_ticket, child_ticket, adult_ticket_price=10.00, child_ticket_price=6.00):
return adult_ticket*adult_ticket_price + child_ticket*child_ticket_price
def calculate_net_profit(gross_profit, percentage_cut=20.0):
return gross_profit*percentage_cut/100
def calculate_distributor_profit(gross_profit, percentage_cut=80.0):
return gross_profit*percentage_cut/100
def print_output(adult_ticket, child_ticket, gross_profit, net_profit, distributor_profit):
print("Adult Ticket Sold: %d" % (adult_ticket))
print("Child Ticket Sold: %d" % (child_ticket))
print("Gross Box Office Profit: $%.2f" % (gross_profit))
print("Net Box Office Profit: $%.2f" % (net_profit))
print("Amount Paid to Distributor: $%.2f" % (distributor_profit))
adult_ticket = get_adult_tickets_sold()
child_ticket = get_child_ticket_sold()
gross_profit = calculate_gross_profit(adult_ticket, child_ticket)
net_profit = calculate_net_profit(gross_profit)
distributor_profit = calculate_distributor_profit(gross_profit)
print_output(adult_ticket, child_ticket, gross_profit, net_profit, distributor_profit)
# copy pastable code link: https://paste.ee/p/ZS3Jh
'''
Sample run:
Adult Tickets Sold: 382
Child Tickets Sold: 127
Adult Ticket Sold: 382
Child Ticket Sold: 127
Gross Box Office Profit: $4582.00
Net Box Office Profit: $916.40
Amount Paid to Distributor: $3665.60
'''
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.