anshi
Junior Member
Reputation: 0
Offline
Posts: 1
Referrals: 0
|
 |
« on: March 11, 2009, 10:02:38 AM » |
|
Hi Friends..
Please help me with your valuable answers..
Merlion hotel has enlisted your company help to revamp an existing application. It has 28 rooms which are numbered 0 to 27. when a guest checks in, the following information has to be recorded: the guest's name, the date of arrival, and the expected number of days the guest will stay.
1. Under the existing system, in order to organise the instances of Guest in order of room number, an array with 28 elements is used. That is, at any given time, the array element with subscript 0 will hold the record for any guest staying in room 0, and so on. Each element in the array may either be null(if the room is empty) or an instance of Guest(if the room is occupied).
Hotel Merlions sister hotel, Hotel Singa, with identical booking procedures but with rooms numbered 1 to 28 wishes to use the same computerised booking system
Explain whether the same array can be used for Hotel Singa, without renaming or renumbering the rooms in some way, (if you think a change must be made, suggest a simple new system that still uses an array to hold the information. Any changes should not make the system any more complicated to operate than that of Hotel Merlion.)
2. The management of Hotel Merlion decides to increase the size of the hotel (i.e., the number of rooms), drop the old numbering system, and rename each room after letters of the alphabet, starting with ‘A’ to ‘Z’. The room after room ‘Z’ is to be room ‘AA’, then room ‘BB’ etc., up to ‘ZZ’.
Under the existing system, it was easy to look up an individual room by room number and find out details of the current occupant (if any).
Suggest (with justification) a collection class, other than Array, of which an instance could be used to hold the instances of Guest and facilitate the use of the new alphabetic room labels to look up guests.
Thanks in advance.. Anshi
|