Reference no: EM131103098
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;
}
Present some arguments to convince him that accounting data
: The chairman of the board of directors of the company for which you are chief accountant has told you that he has little use for accounting figures based on cost.
|
Estimates an unknown population parameter
: Stat 31 Fall 2010 - Homework 1. Statistics and parameters A statistic is a quantity that is calculated from a sample. Give an example of a statistic that estimates an unknown population parameter
|
Save all employees entered on the keyboard
: After the calculation of each employee payment is done, instead of printing all of the employee payments on screen save him or her information into a file called "Payments.dat".
|
Assignment on intellectual property rights issues
: With the increased use of the Internet and the expansion of the global economy, the protection of intellectual property rights has become increasingly difficult.
|
Track of the ticket sales
: Another thing is tht the program should give the user an option to see how many seats havebeen sold, seats available in each row, and seats available in thewhole theater.
|
Provide a brief description of an organization
: Provide a brief description of an organization where you currently work, would like to work, or one in which you have an interest that you have chosen for this assignment.
|
What is the basic accounting problem created by the monetary
: What is the basic accounting problem created by the monetary unit assumption when there is significant inflation? What appears to be the FASB position on a stable monetary unit?
|
Business sales and claim punitive damages
: Tyler has always had a 180 day full warranty from Business Sales when purchasing office equipment over the past five years. On this occasion Tyler purchased a fax machine that broke thirty days after Tyler purchased it. Business Sales asserts taht..
|
What does convert to rage do in the table design
: Suppose that cell A1=1, B1=2 and C1=3, and in Cell A4 we type SUM (A1:C1) and in Cell A5 we type =A1+B1+C1, are the values in Cell A4 and A5 equal? If not explain why.
|