Project
About Cinema has been a part of the entertainment industry for a long time: a good movie is a way to escape reality and live through a variety of emotions. The best cinema experience you can get is probably in a cinema theatre. In this project, you will create an application that helps manage a cinema theatre: sell tickets, check available seats, see sales statistics, and more. Learning outcomes This project is a good opportunity to work with input and output in Kotlin. You will deal with multi-dimensional lists and functions as well as loops and conditional statements.
Description Running a cinema theatre is no easy business. To help our friends, let's add statistics to your program. The stats will show the current income, total income, the number of available seats, and the percentage of occupancy.
In addition, our friends asked you to take care of a small inconvenience: it's not good when a user can buy a ticket that has already been purchased by another user. Let's fix this!
Objectives Now your menu should look like this:
- Show the seats
- Buy a ticket
- Statistics
- Exit When the item Statistics is chosen, your program should print the following information:
The number of purchased tickets; The number of purchased tickets represented as a percentage. Percentages should be rounded to 2 decimal places; Current income; The total income that shows how much money the theatre will get if all the tickets are sold. The rest of the menu items should work the same way as before, except the item Buy a ticket shouldn't allow a user to buy a ticket that has already been purchased.
If a user chooses an already taken seat, print That ticket has already been purchased! and ask them to enter different seat coordinates until they pick an available seat. Of course, you shouldn't allow coordinates that are out of bounds. If this happens, print Wrong input! and ask to enter different seat coordinates until the user picks an available seat.