Bonku Theatre Program (BTP SYSTEM)You shall write a program that would be able to keep track of the seats in a theatre hall inan unknown country called Bonku somewhere in Afrisia(a fictitious continent) . Thereare 22 rows with each row having 15 seats in the Bonku theatre hall. Each seat isuniquely identified by the row and the seat number. There are three types of customersthat come to Bonku theatre hall.Random Customer: This is a customer who orders one or more tickets on the phone.For each random customer you shall record the name and the telephone number, togetherwith which seat that s/he intends to book.Private Subscriber: This is a person who subscribes one (same) seat in the theatre hall.For each Private subscription you shall record the name, address and the telephonenumber, together with the seat number, which s/he subscribes.Corporate Subscriber: This is a company that subscribes more than one (same) seats inthe theatre hall. For each corporate subscription, you shall record the name of thecompany, address, contact person and telephone number, together with which seats thatare subscribed.
(i) You shall declare a Java Class for each of the subscribers.Note that the different kind of subscribers must inherit from a subscriber ( which isa superclass)
(ii) Also declare a Java Class for the Bonku Theater Hall, call itBonkuTheatreHall (you yourself must decide how to declare thestructure for the theatre house). Bonku Theater Hall contains a number ofseats. Refer to the above description. Therefore you must declare the Seat tobe a class also. Call it BTHSeat. Each seat is uniquely identified by therow and column numbers. Declare these as private data in the class seats.
(iii) Draw your data structure . You must also defineall other variables and auxiliary methods and functions that might help yousolve this problem.(iv) In addition, you must define how your file(s) is/are going to look like (fileformat, i.e., how many fields per line, etc). Also note that this data structuresmust be used to solve the remaining questions that follow:[10 marks]
Question 2:You shall write a command-driven program that can make use of the data structureand the file format you defined in Question 1 and which can carry out thecommands that are described below. You have to remember to initialize your datastructure and also write the part of the program that accepts the command.
A : WriteHall The essence of this command is to be able to write onto the screen aline for each row seat in the theatre hall. It shall write a character ( e.g. ‘?’ ) for eachseat in a row, such that ‘?’ means that the seat is available, and ‘B’ means that theseat is booked, ‘R’ means that the seat is reserved by a random customer but theticket has not been collected yet, and ‘S’ means that a ticket for this seat has beensold.
B: OrderTicket The essence of this command is that it asks for the name andtelephone number of a random customer who is ordering a seat via the telephone.Thereafter it shall ask for how many seats that are to be ordered. If there are notenough seats a corresponding error message should be given by this procedure.Thereafter the program shall ask the user to key in the row and the seat numberuntil the total number of seats reserved are keyed in.
C: CollectTicket Here the program shall ask the user to give the telephone numberof a random customer, whereby the seats that are reserved for this telephonenumber were registered as sold. The subscriber shall not collect the ticket.
D: ReadFromFile This command is to be executed just before the program starts. Itshall read from the file ‘subscriber.data’ and update the data structure suchthat the seats in the theatre hall that are reserved for the subscribers are marked assold. The format of the file shall be your responsibility as defined in Question 1.
E: ListSubscribers: This command shall write all seats that have been subscribedand the names of all those who subscribed those seats, one per line onto the screen.
F:Unsuscribe: When this command is carried out, there shall be a request for thetelephone number of the random customer or a subscriber. Thereafter all the seatsthat are reserved by this customer ( random or subscriber) be marked as available. Ifthe customer happens to be a random customer, then remove this customer from thedata structure .
G: Overview : The meaning of this command is to write out how many seats thatare booked by subscribers, how many seats that are sold, how many tickets thathave been ordered but not yet collected and how many seats that are free(available).
H: CancelReservation: This command is called 30 minutes before the beginningof the show ( film, opera, etc). It shall remove/cancel all information about therandom customers who have not as yet collected their tickets. Sketch how the datastructure would look like when this command is carried out.
I: WriteToFile This command is to be executed at the end of the program. It shallwrite all data about the customers to the file ‘subscriber.data’ and updatethe data structure such that the seats in the theatre hall that are reserved for the subscribers are marked as sold. The format of the file shall be your responsibility asdefined in Question 1.
J: Help This command is to be executed any time the user makes a mistake intyping any of the legal commands ( A-J).