Thursday, July 30, 2009

A simple C++ programing using ARRAYS STRUCTS and CLASSES?

Hi. I am a C++ Student in college, enrolled in a simple C++ programming course. In class, the lectures have been about Arrays, Structs and Classes. My professor assigned a program that (to me) is IMPOSSIBLE. I CANNOT FIGURE IT OUT. Before I describe this project, I DO NOT, repeat, DO NOT want a program written. I would, however, like a guideline that puts me in the right direction. As of now, I have no clue how to even begin. Any kind of input, big or small, (even a little encouragement) is GREATLY appreciated.





Here is the project:





Write an object-oriented program that can be used by a small theater to sell tickets for its performances. The auditorium has 15 rows of seats, with 30 seats in each row. (I would probably make a multi-dimensional array here, I'm assuming.. int seats [15][30].. ? ). Design and create class called Theater to encapsulate the functionality specified below.

A simple C++ programing using ARRAYS STRUCTS and CLASSES?
Well you're on the right track.





For reading the prices make a double array.


in_stream %26gt;%26gt; priceArray[integer];


Keep getting values as long as you haven't reached the end of the file. Increment the integer so the next price will be put in the next array element.





====================


Seats that are available are represented by the # symbol, whereas those that are taken are represented by an * symbol.





This will make your seats array of chars. Set all the values = to # by default. When a seat is bought, change the symbol.


===================


Seems like your constructor should take as parameters the number of row, columns and the price array.





==================


Put your switch menu in a do-while loop. Keep running until they choose option 7.


=================


To purchase tickets, the user must enter the row and seat number of the desired seats. Do not accept row or seat numbers that do not exist. In addition, do not sell seats more than once: when the user reque





When they buy, check the char of the seat. If * then tell them it is already taken. If available, then update your variables.


No comments:

Post a Comment