A small Off Broadway Theater is opening in Manhattan. The theater consists of an orchestra section and a balcony. The manager purchased a computer for its automated ticket system; and you’ve been awarded the contract to program the test system that will assign seats for the Opening Night of “String Man”. Your program should display the following choices: Please enter 1 for orchestra and 2 for balcony. If the person types 1, your program will assign a seat in the orchestra section (rows 1-10, 20 seats per row). If the person types 2, your program should assign a seat in the balcony section (rows 11-20, 15 seats per row). Use a two-dimensional irregular array of primitive type boolean to represent the seating chart of the theater. Initialize all the elements of the array to false to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of the array to true to indicate that the seat is no longer available. Your program should never assign a seat that has already been assigned. If either the orchestra section or the balcony becomes full, your program should display a message indicating that section is full; and ask the user if they would like a seat in the remaining section. If the user responds, “no”, your program should display the string, “Next performance is in one week”. If both sections are full, your program should display the string, “Sorry, Opening Night is Sold Out”. When a seat is assigned, your program should print out a ticket indicating the row and seat assignment.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.