CS 161 Assignment 5
Linked Lists, Interfaces

Overview

In this assignment you will implement a Student Database, creating Students and Student collections in the form of Linked Lists. You are given interfaces, a LinkedListNode class, a client class (studentRecords), and an input file (cs161).

You will implement the Student class and a Student Collection class StudentLL, using your own Linked List (not the Java Linked List). These classes implement the Interfaces StudentIF and StudentCollectionIF, respectively. You are provided with the following:

and will finish and submit the Student and StudentLL classes.

Notice that your code will *** NOT COMPILE ***; in particular code that instantiatiates variables of type StudentIF or StudentCollectionIF. To fix this, make Student implement StudentIF and StudentLL implement StudentCollectionIF, and follow the quick fixes from Eclipse to declare the interface methods to be implemented.

StudentIF and StudentCollectionIF

Read the comments in the Interface files. Do not change these.

Student

This is the first class you implement. Check the interface StudentIF.java for a specification. Notice that StudentIF extends Comparable, which means that a class implementing StudentIF must implement all methods in the studentIF including the compareTo() method from the Comparable interface. Make sure you declare that Student implements StudentIF; Eclipse can help you by supplying the correct method declarations. See StudentIF for further information.

StudentLLNode

This class is given to you. Read it so you understand it, as you will use it in StudentLL.java. Do not change this class. Notice that it can contain any class that inherits or implements from Student (polymorphism). As an example, in the follow up assignment P6 you will extend Student with an XcelStudent, who does a project.

StudentLL

Now work on StudentLL; which should implement StudentCollectionIF.java.
***NOTICE***
Recall from StudentIF, that Students are compared by Id; therefore, students with equal id-s cannot be entered in the Collection. Only the first one is entered. Moreover, do not enter a null student.

StudentRecords

This is a provided client class. It gets two command line parameters: input file name and number of grades per student. Don't change this class.

Testing

Test your codes using appropriate main methods. Then, run the StudentRecords client code. Given the input file cs161, your program should produce:
Course cs161: 5 grades
Top Score: 90.0
Ave Score: 76.16
Course: cs161
Jim	1234  50 40 50 60 70	score: 54.00
John	1243  60 70 80 55 55	score: 64.00
Mick	1324  70 60 70 80 90	score: 74.00
Mike	1342  60 70 80 90 99	score: 79.80
Lena	1423  99 50 90 90 85	score: 82.80
Leila	1432  60 70 60 70 60	score: 64.00
Ada	2134  90 90 90 90 90	score: 90.00
Adam	2143  85 95 85 75 65	score: 81.00
Helen	2314  89 79 99 89 88	score: 88.80
Ellen	2341  90 95 88 77 66	score: 83.20
Be aware that StudentRecords does not fully test your code.

Submitting Your Assignment

Create a P5.jar with your Student.java and StudentLL.java and submit it using the checkin web site. DO NOT SUBMIT class files.