A cinema has seats arranged in rows. The two-dimensional (2D) array SeatTaken[] contains, for every seat, the value TRUE if the seat has already been booked and FALSE if the seat is still available. The first index gives the row number and the second index gives the seat number within the row. For example, SeatTaken[3, 7] refers to seat 7 in row 3.
The two-dimensional (2D) array SeatPrice[] contains the price of every seat. The two arrays use the same row and seat indexes, so SeatPrice[3, 7] is the price of seat 7 in row 3.
The variable RowNo contains the number of rows. The variable SeatsInRow contains the number of seats in each row. Every row has the same number of seats.
The arrays and variables have already been set up and the data stored.
Write a program that meets the following requirements:
- counts and outputs the number of seats still available in each row
- calculates and outputs the total number of seats still available in the whole cinema
- calculates and outputs the total amount of money already collected from all the booked seats
- finds and outputs the number of the row with the most seats still available
- asks the user to input the row number and the seat number of the seat they want to book; both inputs must be validated as within the correct range
- if the requested seat is still available, books the seat, outputs the price of the seat and outputs the new total number of seats available in the whole cinema; if the requested seat is already booked, outputs a suitable message.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to initialise the data in the arrays.