English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how do i create a seating chart like this one in C++..

seats
12345678910
Row 1 ** * ** * * ** *
Row 2 #####**###
Row 3 #**##* * * *#
Row 4 ** * ** * * ** *
Row 5 ** * ** * *###

seats that are taken are represented by a * symbol and seats that are not taken are represented by an # symbol... If someone could just give me a little help to get me started i would truelly appreciate it...

2007-12-05 15:01:20 · 3 answers · asked by chris3579589 1 in Computers & Internet Programming & Design

5 rows 10 seats.....the user enters rows and seat numbers being sold...if someone requests ta particular seat thhe program should make sure that seat is available before they are sold....everytime a ticket or group of tickets are sold the program should display the total prices and update the seating chart.....

2007-12-05 17:18:47 · update #1

3 answers

Usually you would store the status of a seat (taken or vacant) in an array - just iterate over the array as you print out their status.

2007-12-05 15:07:11 · answer #1 · answered by mdigitale 7 · 1 0

well, u can start off with a couple of FOR or WHILE loops filling the entire 2-d array (consisting of your rows and columns) with blank seats. then when u ask the user which seat they wanted, just assign the particular 2-d array location the # sign (ex. seat[3][5]). then just make sure that you are still in a loop as long as the user still wants to assign seats.

edit:

btw, you might need to do this dynamically.

2007-12-06 01:29:13 · answer #2 · answered by Neo2010 1 · 0 0

how many rows and seats are there supposed to be?? is someone inputting it? is someone inputting what seats are occupied? or does it just have to out put that?

2007-12-05 23:23:37 · answer #3 · answered by Jorge 3 · 0 0

fedest.com, questions and answers