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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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