Your task for this assignment is to write a program that will accept tickets to various…
- User
Your task for this assignment is to write a program that will accept tickets to various amusement park rides. When the player runs out of tickets, the program ends! Assignment Specifications The player will start out with 50 tickets at the start of their visit to the Amusement Park. The rides and the ticket costs are as follows:
Ferris Wheel: 2 tickets Bumper Cars: 3 tickets Tilt-A-Whirl: 3 tickets Carousel: 2 tickets Log Ride: 5 tickets Funhouse: 1 ticket
The player should be continuously prompted to select a ride until they completely run out of tickets. Once this happens, they should be prompted with the option to purchase more tickets! The player should be allowed to enter how many tickets they would like to purchase (you do not have to worry about implementing a payment feature).
The player should be able to purchase more tickets every time they run out. When the player chooses to purchase more tickets, they should continue to be prompted to choose rides until they both run out of tickets and they choose not to purchase any more.
All of the prompts (both the ride selection and purchasing of tickets) are controlled by single character input. In other words, you should type “a” if you want to select the Ferris Wheel, “b” for the Bumper Cars, etc. To purchase more tickets, this is indicated by “y” (yes, purchase more tickets) or “n” (no more tickets; end the program). You may not assume that the input will be valid. If invalid input is entered, print out a message indicating this and prompt them again. (You may assume letters will be typed either in upper or lower case)
USE WHILE LOOPS ONLY.
- Assistant
Here's a Python program that meets the specifications of the assignment:
python