Question

In: Computer Science

In Python Suppose there is a movie theater who charges ticket based on ages. Less than...

In Python

Suppose there is a movie theater who charges ticket based on ages. Less than 3 years old, free; between 3 to 12, $10; more than 12 years old, $15. Please design a program with loop to,

1) Ask the name then age of the audience,

2) Based on audience's input, tell the audience (with the person's name) how much is the ticket,

3) Stop the program when type in 'quit' in your program.

Solutions

Expert Solution

Python code:

#asking for name
name=input("What is your name? ")
#looping till quit is entered
while(name!='quit'):
#asking for age
age=int(input("What is your age? "))
#checking if the age is less than 3
if(age<3):
#printing name and the ticket price
print("{}, the ticket price is {}".format(name,'free'))
#checking if the age is less than or equal to 12
elif(age<=12):
#printing name and the ticket price
print("{}, the ticket price is ${}".format(name,10))
else:
#printing name and the ticket price
print("{}, the ticket price is ${}".format(name,15))
#asking for name
name=input("What is your name? ")


Screenshot:


Input and Output:


Related Solutions

XYZ operates a movie theater. A movie ticket is $16.00 per ticket, and costs nothing
  XYZ operates a movie theater. A movie ticket is $16.00 per ticket, and costs nothing. On average 40% of the customers will buy a soda ($6 each, cost $1); 60% will buy food ($6 average price with a cost of $2). The fixed costs are $387,600. Calculate the break-even quantity and $sales for tickets, soda and food(10 points)   The theater wishes to make $96,900 profit. Calculate the target profit quantity and sales for tickets, soda and popcorn (10 points)...
1. The movie distributor charges a movie theatre $4 per ticket to rent a movie. Suppose...
1. The movie distributor charges a movie theatre $4 per ticket to rent a movie. Suppose the theatre can seat a maximum of 200 people. The demand for the movie is different for the afternoon showing and for the evening showing. Based on the demand function P = 10 – Q/10 for the afternoon showing and P = 20 – Q/10 for the evening showing, the marginal-revenue function for the afternoon is MR = 10 – Q/5 and for the...
To conduct an experiment, a movie theater increased movie ticket prices from $9 to $10 and...
To conduct an experiment, a movie theater increased movie ticket prices from $9 to $10 and measured the change in ticket sales. The theater then gathered data over the following month to determine whether the price increase was profitable. Assume total costs to the theater are the same, whether the price of a ticket is $9 or $10. In order for the ticket price to have been profitable over the month, the elasticity of demand for movie tickets must be...
An usher at a movie theater claims no more than half of all movie theater customers...
An usher at a movie theater claims no more than half of all movie theater customers buy something at the refreshment stand. To test the claim, the usher observes a random sample of 80 people and finds that 47 of them buy something. a) What is the Null Hypothesis and the Alternative Hypothesis for the usher's claim? b) If we use a 0.01 significance level, what is the critical value for the test? c) Calculate the value of the test...
Problem #4 – Logical Operators: Movie Ticket Price The local movie theater in town has a...
Problem #4 – Logical Operators: Movie Ticket Price The local movie theater in town has a ticket price of $12.00. But, if you are a senior (55 and older), or are under 10, or are seeing a matinee which screens from 3 pm to 5 pm, you get the discounted price of $7.00, nice! Hint 1: "55 and older" is INCLUSIVE Hint 2: under 10 is EXCLUSIVE Hint 3: the range 3 to 5 is INCLUSIVE Hint 4: limit 1...
A movie theater has at most 90 seats available. Each adult movie ticket costs $14, and...
A movie theater has at most 90 seats available. Each adult movie ticket costs $14, and each child movie ticket costs $8. To make a profit, the theater must bring in more than $852 in ticket sales per show. A) In terms of A and C, write an inequality that represents the restriction on total occupancy. B) In terms of A and C, write an inequality that represents the restriction on total ticket sales. C) Make a graph that represents...
The second assignment involves writing a Python program to compute the price of a theater ticket....
The second assignment involves writing a Python program to compute the price of a theater ticket. Your program should prompt the user for the patron's age and whether the movie is 3D. Children and seniors should receive a discounted price. There should be a surcharge for movies that are 3D. You should decide on the age cutoffs for children and seniors and the prices for the three different age groups. You should also decide on the amount of the surcharge...
Consider the movie ticket and popcorn example discussed in Section 17.7. The theater sells two products,...
Consider the movie ticket and popcorn example discussed in Section 17.7. The theater sells two products, tickets and popcorn. Suppose the weekly demand for movie tickets is           Qdtix=500−25Ptix−20Ppopcorn, where Ptix and Ppopcorn are the prices of a ticket and a bag of popcorn, respectively. Suppose that each time a moviegoer buys a ticket, his demand for popcorn is           Qdpopcorn=3−0.4Ppopcorn, where Qdpopcorn is the number of bags of popcorn the moviegoer buys. Suppose further that the theater's...
Scenario Suppose that a movie theater faces a downward sloping demand curve for popcorn and it...
Scenario Suppose that a movie theater faces a downward sloping demand curve for popcorn and it increases the price of a container of popcorn from $4.00 to $4.80, which causes the count of containers sold to fall from 100 to 90. Questions 1. What is the elasticity coefficient? 2. Is the demand relatively elastic or relatively inelastic? 3. Should the theater consider raising the price of popcorn further? 4. When a firm faces a downward sloping demand curve, should it...
EJH Cinemas, a movie theater next to your university, attracts two types of customers: those who...
EJH Cinemas, a movie theater next to your university, attracts two types of customers: those who are associated with the university (students, faculty, and staff) and locals who live in the surrounding area. There are 10,000 university customers interested in purchasing movie tickets from EJH Cinemas, with a maximum willingness to pay of $7 per ticket. There are 20,000 local customers interested in purchasing tickets, with a maximum willingness to pay of $9 per ticket. The movie theater incurs a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT