Question
1. (12 pts) You run a movie theater that uses the following pricing scheme for tickets: Matinee (before 5:00 pm) Evening (5:00 pm or after,
1. (12 pts) You run a movie theater that uses the following pricing scheme for tickets:
| Matinee (before 5:00 pm) | Evening (5:00 pm or after, including midnight showings) |
Regular | $8.00 | $10.50 |
Child (10 or younger) | Free | $4.00 |
Senior (65 or older) | $6.50 | $8.00 |
Write a program that starts by allowing the user to enter the time of their desired showing. The time should be entered in 24-hour format as a single integer; for example, 1615 would be 4:15 pm, 1130 would be 11:30 am, and 0 would be midnight. Midnight is the latest showing offered by the theater.
The program should then prompt the user to enter the ages of all members in his/her party. Once the user has finished entering the ages, the program should report the number of regular, child, and senior tickets sold, along with the subtotals for each of those categories. Finally, the program should show the grand total at the end. Movie theaters generally include sales tax in their ticket prices, so dont worry about adding tax separately.
Heres a sample of what your program might look like when you run it. As usual, the underlined portions indicate what you type into the program as its running.
What time is your showing? 1930 Please enter the age of party member 1:
(any negative value to exit) 21 Please enter the age of party member 2:
(any negative value to exit) 19 Please enter the age of party member 3:
(any negative value to exit) 70 Please enter the age of party member 4:
(any negative value to exit) 3 Please enter the age of party member 5: (any negative value to exit) -1
Order summary:
(Evening rates)
Regular: $ 10.50 x 2 = $ 21.00
Child: $ 4.00 x 1 = $ 4.00
Senior: $ 8.00 x 1 = $ 8.00
TOTAL: $ 33.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started