Professional Documents
Culture Documents
class PassTester - which can be run to show that the Pass class works properly. It
should:
create some suitable Pass objects
a pass ID number, staff name, protection rating, the allowable working hours,
number of hours left to work and the number of moves made .
and call their methods: When attributes or parameters are completed then call
their methods given by the constructor.
In Institute, you are expected to declared fields and add the code for the methods
listed.
"Stubs" for accessors currently return default values; replace them with appropriate
values
You may add any further methods you consider necessary, BUT these additional
methods must have the modifier private, so they cannot be used in client classes
Most of the methods in this class should call/invoke methods on objects of the lower
classes
Methods should NOT deal with any input/output, but use parameters and return value
The largest portion of marks in this task are for the methods: canMove() and move()
Fields:
ArrayLists of all passes, all rooms and all doors (3 ArrayLists)
ArrayList1() in this array details about all the passes.
ArrayList2() in this array save the details about all the rooms.
ArrayList() in this array hold the details about all the doors.
the position of a door in the ArrayList of doors should the same as its number.
In the Arraylist of rooms, “Outside” room should always be at ArrayList location 0.
Constructor:
should call/invoke the three private methods defined at the end of the class to
implement the Corona Institute described in Appendix A (below)
loadPasses - should create all passes and add them to their collection
loadRooms - should create all the rooms in and add them to the collection of all
rooms. These should be added in the order of their numbers
setUpDoors – should create all doors and add them to their collection
Finally, the constructor should add all of the passes to the “Outside” room
.
Helpful methods
[3 private methods at the end of this class, which return each type of object (door,
pass, room) from its collection using key data, may be useful, but not required]
}
you should provide the remaining code as shown by the comments
class accessor
{
String fecility;
int pass_details;
void new_details()
{
Scanner input = new Scanner(System.in);
System.out.print("pass:-");
pass = input.nextLine();
System.out.print("new_details:-");
New_details = input.nextInt();
}
void feci_list()
{
System.out.println(fecility + "\t\t" + accessor);
}
}
Task 5 - System Documentation
You should produce:
a visually neat and readable UML-style class diagram of your system as a screenshot from
BlueJ
Other than Tester and PassTester in Task 1, NO need to write testers for the other
classes
We are looking for evidence of a systematic approach to testing and will expect you to show that
you have identified and tested for the main events likely to occur when the system is running.
Task 8 - Demonstration
On the day after the assignment hand-in, you will be asked to demonstrate that you have a
good working knowledge of the code that you submitted. This will require you to have remote
access to Studynet and to BlueJ on your machine at a specified time. You will be asked to
access your assignment and a written demo specification. In a timed slot of 1 hour 40 mins, you
will be asked to make specified changes and upload your amended code to the Demo
assignment slot.
The main purpose of the demonstration is to authenticate your code by showing that you know it
well enough to use it and make these changes. If you do not undertake this demonstration ,
your assignment will get ZERO marks.
Output Screenshot: