The theater seating map is represented by a table with ticket prices for each seat, like this one. 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 10, 10, 20, 20, 20, 20, 20, 20, 10, 10 10, 10, 20, 20, 20, 20, 20, 20, 10, 10 10, 10, 20, 20, 20, 20, 20, 20, 10, 10 20, 20, 30, 30, 40, 40, 30, 30, 20, 20 20, 30, 30, 40, 50, 50, 40, 30, 30, 20 30, 40, 50, 50, 50, 50, 50, 50, 40, 30 Write a program that asks the user to choose either a place (providing row and column) or a price or to exit from the program. When the user specifies a place, make sure that it is free and that the coordinates are inside the table. When specifying a price, you can assign any seat that’s available at that price (if any). Mark seats already sold with a price equal to 0.
The theater seating map is represented by a table with ticket prices for each
seat, like this one.
10, 10, 10, 10, 10, 10, 10, 10, 10, 10
10, 10, 10, 10, 10, 10, 10, 10, 10, 10
10, 10, 10, 10, 10, 10, 10, 10, 10, 10
10, 10, 20, 20, 20, 20, 20, 20, 10, 10
10, 10, 20, 20, 20, 20, 20, 20, 10, 10
10, 10, 20, 20, 20, 20, 20, 20, 10, 10
20, 20, 30, 30, 40, 40, 30, 30, 20, 20
20, 30, 30, 40, 50, 50, 40, 30, 30, 20
30, 40, 50, 50, 50, 50, 50, 50, 40, 30
Write a program that asks the user to choose either a place (providing row and column) or a price or
to exit from the program. When the user specifies a place, make sure that it is free and that the
coordinates are inside the table. When specifying a price, you can assign any seat that’s available at
that price (if any). Mark seats already sold with a price equal to 0.
Step by step
Solved in 6 steps with 4 images