Track of the ticket sales

Assignment Help C/C++ Programming
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;
}

Reference no: EM131103098

Questions Cloud

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.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Snoopy cache systems and directory based systems

Illustrate how Snoopy Cache Systems and Directory Based Systems operate in the following scenario: Handraw the statuses of the three steps corresponding to the scenario for each system.

  Stored in the array points before line seven

Questions (i) to (vii) relate to the following code. A class called Point is defined and the code fragments that are called from main() are given line numbers 1 to 7.

  Which of the following is a pure abstract function

Which of the following is a pure abstract function?

  A class definition for a date class that contains 3 integer

A class definition for a Date class that contains three integer data members: month, day, and year.

  Pairs of equivalent english spanish words

Create a program to implement a bi-lingual dictionary.set up an array to contain pairs of equivalent english spanish words.When an english word is input, looks up its spanish equivalent and display it.

  Write a program which accepts the total of food and drink

Write a program which accepts the total of food and drink purchased for a restaurant bill as input. The output should be adjusted bill with a sales tax of six percent 6% and a tip (gratuity) of 15%.

  Exponent and significant of a floating point

Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum, subtraction or multiplication.

  Calculate the commission owing for record

Construct an algorithm that will read a record on the file, calculate the commission owing for that record, and print the retail price, commission and employee number.

  Write a short program to simulate a ball being dropped

Write a short program to simulate a ball being dropped off of a tower. To start, the user should be asked for the initial height of the tower in meters.

  Store user input - write c++ program

Write C++ program to provide the following functionality - Ask users to enter 10 integer numbers.

  Write function named enough that takes one integer argument

Write a function named "enough" that takes one integer argument, call it "goal" and returns as its value the smallest positive integer n for which 1+2+3+. . . +n is at least equal to goal .

  What are advantages of cout and cin over printf and scanf

What are advantages of cout and cin over printf() and scanf(). Write the program to enter the name of student, his three subject marks using cout and cin and display the student name and marks? What is the advantages of referencing?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd