1. The room code
The room code is unique to each room and consists of a string of 6
characters. The first three characters are an abbreviation of the building
in which the room resides (e.g., ICT) followed by three numbers that specify
the room number (e.g., 114).
2. Capacity
.This field specifies the maximum number of people that can safely
reside in the room at one time.
3. Building
This is a text field that lists the full name of the building in which
the room resides (e.g., "Information and Communication Technology").
Features to be
implemented |
|
- Correctly declares a new type 'Room' that tracks all the
pertinent information for a room: 1 mark
|
|
- Correctly declares a new type 'RoomList' that is an array of type
'Room' with 100 elements: 1 mark
|
|
- Declares an instance of the array, type 'RoomList': 1 mark
|
|
- Displays instructions on how to use the program each time that
it is run: 1 mark
|
|
- Display a signoff message to indicate to the user that he or she
has quit the program: 1 mark
|
|
- Some form of debug mode has been implemented: 1 mark
|
|
- Displays a menu showing the list management functions: 1 mark
|
|
- (Q)uit: The user can quit the program: 1 mark
|
|
- (D)isplay: Displays the list in a neat and
presentable form (try running the sample executable for an example). Only the occupied array elements will be
displayed. If the array is empty then some sort of status message
should be provided (e.g., "List is empty: nothing to display").
Each room should be separated by a line of stars. When the list is
long, to prevent the output from scrolling off the screen your
program should 'pause' the display every often (say after displaying
a half a doze list elements) while it waits for a response from the
user to tell it to continue (e.g., "Hit enter to continue"). In
order to receive credit for this feature you must have already
implemented some way of adding elements to the list either by
reading from file or by allowing the user to type in the information
for a new element: 2
marks
|
|
- (L)oad: The user will be prompted for the name of the
input file and the program loads the information for the list from
that file. The file that you can use for simple testing is 'mini.txt'.
Before handing in your assignment you should make sure that it also
works with the full sized input file 'rooms.txt'.
You can implement this feature in one of two possible ways: 4 marks
maximum for this feature
|
|
|
- As the information for each room is read in from file it's added
to the end of the list: 2 marks
|
|
|
- As the information for each room is read in from file it's
inserted in correct alphabetical order according to the room code: 4
marks
|
|
- Program can detect and properly handle the case of an empty file
(e.g., 'empty.txt') by displaying
some sort of status message (e.g., "File is empty: nothing to
read"): 1 mark
|
|
- (S)ave: The user can save the list to a file. In order to
receive credit for this feature your program must be able to write
to the original input file and be able to successfully re-read the
updated information again (that means that you must write the
information in a format that is identical to how the information was
originally stored) : 3 marks
|
|
- (F)ind: Program can find details about a particular room.
The user enters the room code and if a
match was found all the information for that room will be displayed
onscreen. Otherwise a suitable error message should be displayed.
The program should not allow the user to search an empty list (a
suitable error message should be displayed):
3 marks
|
|
- (P)resent: Program will all the
rooms with a given capacity. If no rooms of that capacity could be
found then the program should display a suitable message. Also
the program should not allow the user to search an empty list (a
suitable error message should be displayed): 3 marks
|
|
- (A)dd: New rooms can be added to the list if the list is
not yet full (a suitable error message should be
displayed if it is). When this option is selected the user will be
prompted to enter the information for the room to be added. You can
implement this feature in one of two possible ways: 4 marks
maximum for this feature
|
|
|
- New rooms will be added to the end of the list: 2 marks
|
|
|
- New rooms will be inserted in it's correct alphabetical order
according to the room code: 4 marks
|
|
- (R)emove: When this feature is invoked the user will be
prompted to end the room code. If the match was found then the room
is removed otherwise some sort of error message should be displayed
(e.g., "Room 'ICT114' could not be found in the list").
Also the program should not prompt the user to enter the room
information if the list is empty (another error message should be
displayed) : 4
marks
|