Another thing is tht the program should give the user an


Using C programming. Eclipse: I have the following code but Ihave run into some issues, first when it comes to the userinputting more than once seat I cannot make it show that multipleseats are taken and to output that _ number of seats have beentaken at row __ and column __ and contine it until the number ofseats selected have been chosen.

I also want it the chart to update everytime a ticket(s) are purchased and give me the total ticket prices. It should keep track of the ticket sales, and the usershould be given that option to see tht. Another thing is tht theprogram should give the user an option to see how many seats havebeen sold, seats available in each row, and seats available in thewhole theater.

void mapSeats (int i, int j, char sts[][30])
{
// char TAKEN = '*';
// char EMPTY = '#';
int rw = 15;
int col = 30;
printf (" Seatsn");
fflush (stdout);
printf (" 012345678901234567890123456789");
fflush (stdout);
for (i = 0; i < rw; i = i + 1) {
printf ("nRow %2d ", i);
fflush (stdout);
for (j = 0; j < col; j = j + 1) {
printf ("%c", sts[i][j]);
fflush (stdout);
}
}
putchar ('n');
}
void theatre (void)
{
int row = 15;
int column = 30;
float prices[15];
char sts[row][column];
char TAKEN = '*';
char EMPTY = '#';
int reserve;
int i = 0;
int j = 0;
int k=0;
// float cost;
// int static total;
printf ("Enter the price for each row of seats.n");
fflush (stdout);
for (row = 0; row < 15; row = row + 1) {
printf ("Row %2d:n", row);
fflush (stdout);
scanf ("%f", &prices[row]);
}
// printf("What would you like to do? Select a number:n");
// printf("1: Reserve seats");
// printf("2: View total ticket sales");
// printf("3: View sold and available seats");
for (i = 0; i < row; i = i + 1) {
for (j = 0; j < column; j = j + 1) {
sts[i][j] = EMPTY;
}
}
mapSeats (i, j, sts);
printf ("nHow many seats would you like to reserve?n");
fflush (stdout);
scanf ("%d", &reserve);
printf ("Enter the row and column number for the desired seat(s).n");
fflush (stdout);
for (k=1 ; k <= reserve; k=k+1) {
scanf ("%d %d", &row, &column);
printf ("nYou have selected Row %d, Column %dn", row, column);
fflush (stdout);
for (i = 0; i < 15; i = i + 1) {
for (j = 0; j <= 30; j = j + 1) {
if (row == i && column == j) {
sts[i][j] = TAKEN;
}
}
}
}
mapSeats (i, j, sts);
}
int main (void)
{
theatre ();
return 0;
}

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Another thing is tht the program should give the user an
Reference No:- TGS01481099

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)