write a program to handle ticket sales for an auditorium

write a program to handle ticket sales for an auditorium. A given show will be performed on three days – Thursday, Friday and Saturday. There are three seating areas – floor, balcony and upper balcony. There are 20 seats in each section (it’s a very small auditorium, only one row per section!) Floor seats sell for $30, balcony for $20 and upper balcony for $10.
The program will allow the cashier to enter requested seat purchases by desired day, section and seat number. It will check if the seat is available and, if so, mark the seat as sold. When requested, the program will be able to display a seating chart or a summary of ticket sales.
Data for the seating availability will be stored in multidimensional arrays – either a single three-dimensional array (ordered by day, section, seat number) or by three two-dimensional arrays (each day’s array ordered by section and seat number). The array(s) should initially be set to show all seats available. As the cashier sells seats, change the array element value to indicate that it’s sold. Needs to use hyphen ( - ) to indicate available seats and asterisk ( * ) to indicate sold seats.

#include <iostream>
#include <string>

using namespace std;

void get_menu_choice(char tickets[][3][20]);
bool sell_seat(char tickets[][3][20]);
void print_day_list(char tickets[][3][20]);
void print_floor_list(char tickets[][3][20]);
void print_chart();
const char FULL ='*';
const char EMPTY = '-';
const int rows = 3;
const int seats = 20;
const int days = 3;
char map [days][rows][seats];

int main()
{
char tickets[3][3][20];
bool done = false;
while (!done)
{
done = sell_seat(tickets);
}
print_day_list(tickets);
print_floor_list(tickets);
get_menu_choice(tickets);

int choice;

do
{

switch(choice)
{
case 'S':
cout << "S - Sell a Ticket.";
sell_seat(tickets);
break;
case 'C':
cout << "C - Display Seating Chart.";
print_chart();
break;
case 'D':
cout << "D - Display Sales Summary - Day Listing";
print_day_list(tickets);
break;
case 'F':
cout << "F - Display Sale Summary - Floor Listing";
print_floor_list(tickets);
break;
case 'Q':
cout << "Quit";
break;
default:
cout << "Invalid choice. Try again!" << endl;
break;
}
}while(choice != 'Q');

return 0;
}
void get_menu_choice(char tickets[][3][20])
{
int MenuChoice;

cout << "\t *** Main Menu *** " << endl;
cout << "S - Sell a Ticket." << endl;
cout << "C - Display Seating Chart." << endl;
cout << "D - Display Sales Summary - Day Listing" << endl;
cout << "F - Display Sale Summary - Floor Listing" << endl;
cout << "Q - Quit" << endl;
cout << "Your Choice: ";
cin >> MenuChoice;
cout << endl;

}
bool sell_seat(char tickets[][3][20])
{
char choice, level;
int day, location;

cout << "Enter seat request by day (T)hursday, (F)riday, (S)aturday"
<< " followed by Section (F)loor, (B)alcony, (U)pper Balcony\n"
<< " followed by seat number (1-20).";

cin >> choice;

choice = toupper(choice);

if (choice == 'T')
day = 0;
else if (choice == 'F')
day = 1;
else if (choice == 'S')
day = 2;
else
{
cout << "Invalid day entered, try again\n";
return false;
}
cin >> level;
level = toupper(level);
if (level == 'F' )
location = 0;
else if (level == 'B')
location = 1;
else if (level == 'U')
location = 2;
else
{
cout << "Invalid location entered, try again\n";
return false;
}
for (int count = 0; count < 20; count++)
{
if (tickets[day][location][count] == '*')
{
tickets[day][location][count] = 'S';
return false;
}
}
cout << "All seats filled for " << choice << " at location " << level
<< " try again" << endl;
return false;
}
void print_chart()
{
string dayTitles[3] = {"Thursday ", "Friday ", "Saturday "};
string locationTitles[3] = {"Floor ", " Balcony ", " Upper Balcony "};

for (int i = 0; i < 3; i ++)
{
cout << dayTitles[i];
for(int j = 0; j < 3; j++)
{
cout << locationTitles[j];
cout << " " << map[i][j] << endl;
}
}
}
void print_day_list(char tickets[][3][20])
{
string dayTitles[3] = {"Thursday ", "Friday ", "Saturday "};
string locationTitles[3] = {"Floor ", " Balcony ", " Upper Balcony "};
int totalSold = 0, dayTotal[3] = {0}, locationTotal[3] = {0}, sold, dayAmount[3] = {0};
int amount[3] = {0};
int price[3] = {30, 20, 10};
for (int day = 0; day < 3; day ++)
{
cout << dayTitles[day] << endl;
for (int location = 0; location < 3; location++)
{
if(location !=0)
cout << '\t';

cout << locationTitles[location];
sold = 0;
for (int seats = 0; seats < 20; seats++)
{
if(tickets[day][location][seats] == 'S')
{
sold++;
totalSold++;
dayTotal[day]++;
locationTotal[location]++;
dayAmount[day] += price[location];
}
}
cout << '\t' <<"Tickets sold " << sold << " $" << sold * price[location] << endl;
amount[location] += sold * price[location];
}
}
cout << "\nTotal tickets sold for all concerts " << totalSold
<< " $ " << amount[0] + amount[1] + amount[2] << endl << endl;
}
void print_floor_list(char tickets[][3][20])
{
string locationTitles[3] = {"Floor ", "Balcony ", "Upper Balcony "};
string dayTitles[3] = {"Thursday ", " Friday ", " Saturday "};
int totalSold = 0, locationTotal[3] = {0}, dayTotal[3] = {0}, sold, locationAmount[3] = {0};
int amount[3] = {0};
int price[3] = {30, 20, 10};
for (int location = 0; location < 3; location++)
{
cout << locationTitles[location] << endl;
for (int day = 0; day < 3; day++)
{
if(day !=0)
cout << '\t';

cout << dayTitles[day];
sold = 0;
for (int seats = 0; seats < 20; seats++)
{
if(tickets[location][day][seats] == 'S')
{
sold++;
totalSold++;
locationTotal[location]++;
dayTotal[day]++;
locationAmount[location] += price[day];
}
}
cout << '\t' <<"Tickets sold " << sold << " $" << sold * price[day] << endl;
amount[day] += sold * price[day];
}
}
cout << "\nTotal ticket sales for all shows: " << totalSold
<< " $ " << amount[0] + amount[1] + amount[2] << endl << endl;
}
it runs but this is what i get Enter seat request by day (T)hursday, (F)riday, (S)aturdayfollowed by Section (F)loor, (B)alcony, (U)pper Balcony
followed by seat number (1-20)./n Invalid day entered, try again
then it keeps asking but its still in invalid
before I tell you your problem, please put your code between blocks which are generated with the <> button. Now for your problem. in function bool sell_seat it sounds like you are asking the user to input the data all at once. I know that that isn't what you want based on your code but rewrite that. Now, if you aren't doing that, are you typing in lowercase because your program doesn't allow for that
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

void get_menu_choice(char tickets[][3][20]);
void sell_seat(char tickets[][3][20]);
void print_day_list(char tickets[][3][20]);
void print_floor_list(char tickets[][3][20]);
void print_chart(float seats[rows][columns]);
const char FULL ='*';
const char EMPTY = '-';
const int rows = 3;
const int columns = 20;
const int days = 3;
char map [days][rows][seats];

int main()
{
	char tickets[3][3][20];
	get_menu_choice(tickets);
	print_chart(seats);
	sell_seat(tickets);
	print_day_list(tickets);
	print_floor_list(tickets);
	
	int choice;

	do
	{
		switch(choice)
		{
		case 'S':
			cout << "S - Sell a Ticket.";
			sell_seat(tickets);
			break;
		case 'C':
			cout << "C - Display Seating Chart.";
			print_chart(seats);
			 break;
		case 'D':
			cout << "D - Display Sales Summary - Day Listing";
			print_day_list(tickets);
			break;
		case 'F':
			cout << "F - Display Sale Summary - Floor Listing";
			print_floor_list(tickets);
			break;
		case 'Q':
			cout << "Quit";
			break;
		default:
			cout << "Invalid choice. Try again!" << endl;
			break;
		}
		}while(choice != 'Q');

	cin.clear();
	cin.sync();
	return 0;
}
void get_menu_choice(char tickets[][3][20])
{
	char MenuChoice;

	cout << "\t *** Main Menu *** " << endl;
	cout << "S - Sell a Ticket." << endl;
	cout << "C - Display Seating Chart." << endl;
	cout << "D - Display Sales Summary - Day Listing" << endl;
	cout << "F - Display Sale Summary - Floor Listing" << endl;
	cout << "Q - Quit" << endl;
	cout << "Your Choice: ";
	cin >> MenuChoice;
	cout << endl;

}
void sell_seat(char tickets[][3][20])
{
	char choice, level;
	int day, location;

	cout << "Enter seat request by day (T)hursday, (F)riday, (S)aturday" << endl;
	cout << "followed by Section (F)loor, (B)alcony, (U)pper Balcony" << endl;
	cout << "followed by seat number (1-20)." << endl;
	cin >> choice >> level >> Count;

	choice = toupper(choice);

	if (choice == 'T')
		day = 0;
	else if (choice == 'F')
		day = 1;
	else if (choice == 'S')
		day = 2;
	else
		{
		cout << "Invalid day entered, try again\n";

		}
	cin >> level;
	level = toupper(level);
	if (level == 'F' )
		location = 0;
	else if (level == 'B')
		location = 1;
	else if (level == 'U')
		location = 2;
	else
		{
		cout << "Invalid location entered, try again\n";

		}
	for (int Count = 0; Count < 20; Count++)
	{
		if (tickets[day][location][Count] == '*')
		{
			tickets[day][location][Count] = 'S';

		}
	}
		cout << "All seats filled for " << choice << " on the " << level << " at seat" 
				<< Count << " try again" << endl;

}
void print_chart(float seats[rows][columns])
{
	for(int y = 0; y < rows; y++)
	{
		for(int x = 0; x < columns; x++)
			if(seats[y][x] == 0.00)
			{
				cout << "-";
			}
			else
			{
				cout << "*";
			}
	}
	cout << endl;
}
void print_day_list(char tickets[][3][20])
{
	string dayTitles[3] = {"Thursday ", "Friday   ", "Saturday "};
	string locationTitles[3] = {"Floor         ", " Balcony       ", " Upper Balcony "};
	int totalSold = 0, dayTotal[3] = {0}, locationTotal[3] = {0}, sold, dayAmount[3] = {0};
	int amount[3] = {0};
	int price[3] = {30, 20, 10};
	for (int day = 0; day <  3; day ++)
	{
		cout << dayTitles[day] << endl;
		for (int location = 0; location < 3; location++)
		{
			if(location !=0)
				cout << '\t';

			cout << locationTitles[location];
			sold = 0;
			for (int seats = 0; seats < 20; seats++)
			{
				if(tickets[day][location][seats] == 'S')
				{
					sold++;
					totalSold++;
					dayTotal[day]++;
					locationTotal[location]++;
					dayAmount[day] += price[location];
				}
			}
			cout << '\t' <<"Tickets sold " << sold << " $" << sold * price[location] << endl;
			amount[location] += sold *  price[location];
		}
	}
	cout << "\nTotal tickets sold for all concerts " << totalSold
		 << " $ " << amount[0] + amount[1] + amount[2] << endl << endl;
}
void print_floor_list(char tickets[][3][20])
{
	string locationTitles[3] = {"Floor ", "Balcony   ", "Upper Balcony "};
	string dayTitles[3] = {"Thursday         ", " Friday       ", " Saturday "};
	int totalSold = 0, locationTotal[3] = {0}, dayTotal[3] = {0}, sold, locationAmount[3] = {0};
	int amount[3] = {0};
	int price[3] = {30, 20, 10};
	for (int location = 0; location <  3; location++)
	{
	cout << locationTitles[location] << endl;
	for (int day = 0; day < 3; day++)
	{
		if(day !=0)
			cout << '\t';

		cout  << dayTitles[day];
		sold = 0;
		for (int seats = 0; seats < 20; seats++)
		{
			if(tickets[location][day][seats] == 'S')
			{
				sold++;
				totalSold++;
				locationTotal[location]++;
				dayTotal[day]++;
				locationAmount[location] += price[day];
			}
		}
		cout << '\t' <<"Tickets sold " << sold << " $" << sold * price[day] << endl;
		amount[day] += sold *  price[day];
	}
	}
	cout << "\nTotal ticket sales for all shows: " << totalSold
			<< " $ " << amount[0] + amount[1] + amount[2] << endl << endl;
}

there is something wrong with the seats in the int main part and something wrong with the count in the void sell_seat. but other than that i think i got most of it i hope!
Where do you get choice in the loop?
in int main you made choice not intialized (i spelled that wrong) but used it for the switch case. I didn't see anywhere in main where its given a value even by a different function
not sure i need to loop my void sell_seat but dont know how
so I am programming an rpg and I needed to loop my functions (which were used as rooms) and to do that I did something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>

using namespace std;

int state = 1;

void function1();
void function2();
void function3();

int main()
{
while(state != -1)
{
switch (state)
{
case 1:
function1();
break;

case 2:
function2();
break;

case 3:
function3();
break;
}
}
}

void function1()
{
//some code
state = 2;
}

void function2()
{
//some code
state = 3;
}

void function3()
{
//some code
state = 1;
}
or something along those lines credit for this goes to hamsterman
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

void get_menu_choice(char &MenuChoice);
void sell_seat(char& tickets[][3][20]);
void print_day_list(char &tickets[][3][20]);
void print_floor_list(char& tickets[][3][20]);
void print_chart(float &seats[rows][columns])
const char FULL ='*';
const char EMPTY = '-';
const int rows = 3;
const int columns = 20;
const int days = 3;


int main()
{
	char MenuChoice ; 
	char tickets[3][3][20];
	get_menu_choice(MenuChoice);
	print_chart(seats);
	sell_seat(tickets);
	print_day_list(tickets);
	print_floor_list(tickets);
	
	char choice;
	cout<<"\n Enter the choice ";
	cin>>choice ;
	choice = toupper ( choice ) ; 
	do
	{
		switch(choice)
		{
		case 'S':
			cout << "S - Sell a Ticket.";
			sell_seat(tickets);
			break;
		case 'C':
			cout << "C - Display Seating Chart.";
			print_chart(seats);
			 break;
		case 'D':
			cout << "D - Display Sales Summary - Day Listing";
			print_day_list(tickets);
			break;
		case 'F':
			cout << "F - Display Sale Summary - Floor Listing";
			print_floor_list(tickets);
			break;
		case 'Q':
			cout << "Quit";
			break;
		default:
			cout << "Invalid choice. Try again!" << endl;
			break;
		}
		}while(choice != 'Q');

	cin.clear();
	cin.sync();
	return 0;
}
void get_menu_choice(char &MenuChoice)
{


	cout << "\t *** Main Menu *** " << endl;
	cout << "S - Sell a Ticket." << endl;
	cout << "C - Display Seating Chart." << endl;
	cout << "D - Display Sales Summary - Day Listing" << endl;
	cout << "F - Display Sale Summary - Floor Listing" << endl;
	cout << "Q - Quit" << endl;
	cout << "Your Choice: ";
	cin >> MenuChoice;	

}
void sell_seat(char& tickets[][3][20])
{
	char choice, level;
	int day, location;

	cout << "Enter seat request by day (T)hursday, (F)riday, (S)aturday" << endl;
	cout << "followed by Section (F)loor, (B)alcony, (U)pper Balcony" << endl;
	cout << "followed by seat number (1-20)." << endl;

	do{
			cin >> choice ;

			choice = toupper(choice);
				switch( choice )
				{
					case 'T':
						day = 0;
						break;
					case 'F':
						day = 1;
						break;
					case 'S':
						day = 2;
						break;
						default:
							cout<<"Invalid choice \t try again";
				}
			} while( choice != 'T' || choice != 'F' || choice != 'S' ) ; 

	do{
			cin >> level ;

			level = toupper(level);
				switch( level )
				{
					case 'F':
						location = 0;
						break;
					case 'B':
						location = 1;
						break;
					case 'U':
						location = 2;
						break;
						default:
							cout<<"Invalid choice \t try again";
				}
			} while( choice != 'F' || choice != 'B' || choice != 'U' ) ; 


	int Count  = 0; 
	for (Count = 0; Count < 20; Count++)
	{
		if (tickets[day][location][Count] == '*')
		{
			tickets[day][location][Count] = 'S';
			break;

		}
	}
	if( Count == 20 ) 
	{
		cout << "\n All seats filled for "  ; 
	}else
	{
			cout<<"\n Seat booked at "<< day << " location " << location <<"count "<<Count;
	}

}
void print_chart(float &seats[rows][columns])
{
	for(int y = 0; y < rows; y++)
	{
		for(int x = 0; x < columns; x++)
			if(seats[y][x] == 0.00)
			{
				cout << "-";
			}
			else
			{
				cout << "*";
			}
	}
	cout << endl;
}
void print_day_list(const char &tickets[][3][20])
{
	string dayTitles[3] = {"Thursday ", "Friday   ", "Saturday "};
	string locationTitles[3] = {"Floor         ", " Balcony       ", " Upper Balcony "};
	int totalSold = 0, dayTotal[3] = {0}, locationTotal[3] = {0}, sold = 0, dayAmount[3] = {0};
	int amount[3] = {0};
	int price[3] = {30, 20, 10};
	for (int day = 0; day <  3; day ++)
	{
		cout << dayTitles[day] << endl;
		for (int location = 0; location < 3; location++)
		{
			cout << locationTitles[location];
			sold = 0;
			for (int seats = 0; seats < 20; seats++)
			{
				if(tickets[day][location][seats] == 'S')
				{
					sold++;
					totalSold++;
					dayTotal[day]++;
					locationTotal[location]++;
					dayAmount[day] += price[location];
				}
			}
			cout << '\t' <<"Tickets sold " << sold << " $" << sold * price[location] << endl;
			amount[location] += sold *  price[location];
		}
	}
	cout << "\nTotal tickets sold for all concerts " << totalSold
		 << " $ " << amount[0] + amount[1] + amount[2] << endl << endl;
}
void print_floor_list(char tickets[][3][20])
{
	string locationTitles[3] = {"Floor ", "Balcony   ", "Upper Balcony "};
	string dayTitles[3] = {"Thursday         ", " Friday       ", " Saturday "};
	int totalSold = 0, locationTotal[3] = {0}, dayTotal[3] = {0}, sold, locationAmount[3] = {0};
	int amount[3] = {0};
	int price[3] = {30, 20, 10};
	for (int location = 0; location <  3; location++)
	{
	cout << locationTitles[location] << endl;
	for (int day = 0; day < 3; day++)
	{

		cout  << dayTitles[day];
		sold = 0;
		for (int seats = 0; seats < 20; seats++)
		{
			if(tickets[location][day][seats] == 'S')
			{
				sold++;
				totalSold++;
				locationTotal[location]++;
				dayTotal[day]++;
				locationAmount[location] += price[day];
			}
		}
		cout << '\t' <<"Tickets sold " << sold << " $" << sold * price[day] << endl;
		amount[day] += sold *  price[day];
	}
	}
	cout << "\nTotal ticket sales for all shows: " << totalSold
			<< " $ " << amount[0] + amount[1] + amount[2] << endl << endl;
}


you may try this .
there are a few problems with that though
Topic archived. No new replies allowed.