This assignment has two primary tasks,
The second assignment assesses students skills on the following topics,
STEP 1
Your rst task is to complete the Student class by adding the following,
We have deliberately not provided the method headers (except that for the constructor). The requirements for each method is provided in the Student.java le and you are required to add the methods based on the comments. Also, the JUnit test class StudentTest invokes methods from Student. You can use those method invocations as hints to complete the methods of Student class. We suggest you complete the methods in three steps,
STEP 2: Test the Student class
Test the Student class by running the JUnit tests in StudentTest. Also, run the class Client.java. If step 1 has been nished correctly, you should get two sets of displays, raw, and sorted, which are the same for now because the sort methods have not been completed.
STEP 3: Searching and Sorting
Complete the following methods (in the suggested order) in class StudentArrayService.
The method headers are provided for this class and above them the method requirements are stated.
Please note that sorting is based on the compareTo method from Student class. Thus, s1.compareTo(s2) == 1impliesthatstudents1ismorethan students2. Similarly,s1.compareTo(s2) == -1 implies that student s1 is less than student s2. And nally s1.compareTo(s2) == 0 implies that student s1 and student s2 are the same in terms of sorting.
You are provided with a template for the project. Import the project into Eclipse. As you complete the methods, you can test the correctness of your solutions using the JUnit tests provided in the StudentTest.java and StudentArrayServiceTest.java classes. Please note that the setup() method in the test classes runs before every other test method.