(Solved) : Examples Following Input 15 15 11 2 15 15 15 15 15 15 15 15 3 Output 2 Row 2 Col 13 Explan Q34271705 . . .
in language c please.and follow the manual![uestion 1: Functions and Pointers. In this question we simulate a ticket reservation system for a show. When a customer calls to reserve ticket he anticipates that all the audience for whom he reserved would sit next to each other In C-a-show theater, there are 12 rows. In each row there are 15 seats Use #define in order to be able to convert those measures to fit other theaters. The constant ROWS will define the number of rows in the theater The constant COLS will define the number of seats in each row You are requested to write a program that receives reservations for tickets, for each reservation of X tickets, the program will check if its possible to seat all the reserves in one row, next to one another If its possible, the program will save the seats for them, and will print the numbers of the saved seats. Otherwise the program will end. More details regarding the implementation and examples will follow after the functions definition. In order to implement your program, you have to implement the following functions 1. Iniializing function with the following declaration void InitAuditorium (int arr [ROWS] [COLS]) The function receives an array and initializes it with values which indicate that the theater is empty. Arr -the array that contains data about the reserved seats. 2. Function of the inputs with the following declaration int getNumTicketsAsked () The function gets the number of tickets to be reserved by the user and returns it. You are allowed to assume that the user input is an integer. You have to check that the number is a positive number (greater than zero); if the number is non-positive, then it should return -1 3. Calculation function with the following declaration void findAvailableSeats (int arr [ROWS] [COLS], int num, int row, int col) The function receives: An array that contains data of the reserved seats. .The number of required adjacent seats. A pointer to row number A pointer to column number The function searches for num empty adjacent seats in the same row. To do this, it will start with [row 0, seat 0]: if its reserved, then the function will check [row 0, seat 1] .[row 0, seat 2].. etc. (If there are no num empty seats in the first row, we do the same process for the second row, third row... etc.) The function returns the row and the column of the first seat, of the sequence of founded seats (by the pointers row and col respectively). Otherwise returns -1, l](https://media.cheggcdn.com/media%2F4c5%2F4c57525c-45a7-48e8-9615-74c65c6f708c%2Fphpu2Fasv.png)


We were unable to transcribe this imageWe were unable to transcribe this imageExamples: For the following input: 15 15 11 2 15 15 15 15 15 15 15 15 3 Your output should be: 2 row-2 col-13 Explanation: In the row 0 and 1, there will be 15 persons in each line. In the row 2, there will be 11 persons and 2 more In the following rows: 3-11, 15 persons will seat in each line. If we want to seat more 3 persons, there will be no place in the hall, due to the fact that there are just two available seats in the row 2 (13,14). persons beside them. For the following input: 15 5 4 15 15 15 2 15 15 4 15 15 15 15 15 7 Your output should be: Explanation: In the row 0 and 1, there will be 15 persons. In the row 1, there will be 5 persons and 4 more In the row 1 and 2, there will be 15 persons in each line. Later we seated more 2 persons in row 1. In the row 5 and 6, there will be 15 persons in each line. Later we seated more 4 persons in row 1. In the following rows: 3-11, 15 persons will seat in each line. In the following rows: 7-11, 15 persons will seat in each line. Later, when we are trying to seated more 7 persons, we find out that there is no available seats persons beside thenm Note: In the end of each line vou have to add “new line” (by In Show transcribed image text
Expert Answer
Answer to Examples Following Input 15 15 11 2 15 15 15 15 15 15 15 15 3 Output 2 Row 2 Col 13 Explan Q34271705 . . .
OR