Note alsothat registrycli requires reference suitable registry object
|
Laboratory Exercises |
---|
Exercise 1: Creating the Class Student
Write a class to represent students. For the purposes of this exercise assume that a student is defined as follows:
The data type ArrayList in Java offers a dynamic data structure with fast read access. Whilst this is ideal for many problems, the structure is not suitable for every eventuality. In some contexts, write access to a data structure (i.e. inserting and deleting elements) is time critical and must therefore be implemented as efficiently as possible. Unfortunately, when re-organising, e.g. removing or adding elements in a large ArrayList, a lot of computational time can be taken up by having to “shuffle” elements about.
Laboratory Exercises |
---|
public Registry() {}
public void addStudent(Student aStudent) {}
Write a class to test all of the methods in Registry. Test runs should have on-screen narrative to explain the purpose of each test and to compare actual results with those expected. For example, part of the test output might look like this.
Registry Tester
***************
1001PG |
|
||
---|---|---|---|
|
1002UG | ||
1003UG | |||
|
Here the user has selected option 1 so they should be presented with an input screen.
Add New Student
***************
Enter forename :> Dave
Enter surname :> Perkins
Enter student ID :> 1001UG
Enter degree scheme :> BSc Mathematics Enter another (Y/N) :> n
|
---|
Do not use recursion to implement the menu system. Submissions which involve recursion will be
penalised.
// Display the menu
theRegistryCLI.doMenu();
}
}
*************************
For this piece of assessed work you are required to complete Exercises 1-3 and submit the following
source files:
• RegistryInterface.java
• RegistryApp.java
Submission Notes and Marking Scheme
• | ||
---|---|---|
• |
|
|
|
||
• | ||
• | ||
• |
|
|
|