Beruflich Dokumente
Kultur Dokumente
General requirements
All input will be a sequence of lines of the following form:
Cancel <id>
o cancel reservation <id> (if it exists) and free up rooms
Print <name>
o print occupancy of each room in the venue <name>
Assumptions
Test Cases
Booking request:
1.
2.
3.
4.
Housekeeping
All Java source files should be in the default package.
Main class shall be called VenueHireSystem.java.
I/O
Input shall be done as a text file name argument passed into the main method in the call
java VenueHireSystem.
Print output should be directed to System.out.
If a reservation request cannot be fulfilled, print out Request rejected.
If a change cannot be made, print out Change rejected.
If a cancellation cannot be done, print out Cancel rejected.
To read input from a text file, use code such as:
Scanner sc = null;
try
{
sc = new Scanner(new FileReader(args[0]));
first command line argument
}
catch (FileNotFoundException e) {}
finally
{
if (sc != null) sc.close();
}
# args[0] is the
Sample IO
Input
Cancel 3
# Cancel reservation 3
# Deassign Figtree room of Gardens (output Cancel
3)Request 5 Mar 26 Mar 26 1 small
# Request 5 is for 1 small room from Mar 26 to Mar
26
# Request cannot be fulfilled (output Request
rejected)
Print Zoo
# Print out occupancy of all rooms at Zoo, in order
of room declarations, then date;
# for each reservation giving the start date and
number of days occupied
Output
Cancel 3
Request rejected
Zoo Hippo