SheilaMarie
2013-01-08 01:20:58 UTC
Objectives:
• To learn how to use looping structures.
• To learn how to format numbers.
Problem B: Ticket Window
Your favorite New York City Play Company has requested a demand sensitive ticket window program. Because every show is sold out well before the play starts, the Board of Directors believed that to increase the revenue, a demand-based ticket window should be used. This means that since there are a limited number of tickets available for each show, the current ticket price at the moment is calculated by the following equation.
CurrentTicketPrice = (MaximumTicketPrice/TicketsAvailable)
There should also be an option to set the minimum ticket price so that the price can be regulated. Your program will run until all the tickets are sold. You must check to make sure that no one asks for more tickets than are available at any point in time. The Board of Directors would also like to know the Total Income for the night once all the tickets have been sold.
Sample Output 1:
Welcome to Rent’s Ticket Window.
How many tickets are available? 5
What is the Maximum Ticket Price? P500
What is the Minimum Ticket Price? P20
--------------------------------------
Tickets are currently: P100.00
We only have 5 ticket(s) available.
How many tickets would you like to buy? 1
1 Ticket(s) will be P100.00
Enjoy the show!
--------------------------------------
Tickets are currently: P125.00
We only have 4 ticket(s) available.
How many tickets would you like to buy? 2
2 Ticket(s) will be P250.00
Enjoy the show!
--------------------------------------
Tickets are currently: P250.00
We only have 2 ticket(s) available.
How many tickets would you like to buy? 2
2 Ticket(s) will be P500.00
Enjoy the show!
--------------------------------------
We are now Sold Out!
Tonight we brought in P850.00
Sample Output 2:
Welcome to Rent’s Ticket Window.
How many tickets are available? 50
What is the Maximum Ticket Price? P2500
What is the Minimum Ticket Price? P500
--------------------------------------
Tickets are currently: P500.00
We only have 50 ticket(s) available.
How many tickets would you like to buy? 4
4 Ticket(s) will be P2000.00
Enjoy the show!
--------------------------------------
Tickets are currently: P500.00
We only have 46 ticket(s) available.
How many tickets would you like to buy? 40
40 Ticket(s) will be P20,000.00
Enjoy the show!
--------------------------------------
Tickets are currently: P500.00
We only have 6 ticket(s) available.
How many tickets would you like to buy? -9
Please enter a number between 0 and 6.
--------------------------------------
Tickets are currently: P500.00
We only have 6 ticket(s) available.
How many tickets would you like to buy? 10
Please enter a number between 0 and 6.
--------------------------------------
Tickets are currently: P500.00
We only have 6 ticket(s) available.
How many tickets would you like to buy? 3
3 Ticket(s) will be P1,500.00
Enjoy the show!
--------------------------------------
Tickets are currently: P833.33
We only have 3 ticket(s) available.
How many tickets would you like to buy? 3
3 Ticket(s) will be P2,500.00
Enjoy the show!
--------------------------------------
We are now Sold Out!
Tonight we brought in P26,000.00
>> I really need your help guys.. Thanks in Advance :-)