Project 8
Due Date: beginning of lecture, Thursday, April 24, 2003
(late projects will be accepted through May 1, with the usual late fee)
The goal of this project is to build on Project
7, to build a collection of students that might represent a course.
Part 1:
Add and test a method to your Student class, a "getter" called getStudentID(),
which just returns the ID of the given student.
Part 2:
The file StudentCollection.java contains a Java class that will
represent a course of students. Four methods are provided:
-
a constructor, which creates an empty collection and sets its current size
to 0;
-
a getter that returns the current size;
-
a toString method that creates a giant string containing the whole collection;
-
finally, a method that adds a student to the collection
In this part of the project, you'll add two more methods:
-
a boolean method that accepts as a parameter a student ID, then attempts
to delete the corresponding student, returning true if the deletion
succeeds and false if that ID is not present in the course;
-
a method that accepts a student ID, then attempts to find and return the
corresponding student object. If the ID is not present in the course, this
method returns null (see p. 270-271 regarding null).
Develop a test plan for the revised collection class (including the addStudent
method), and a test program that carries out your plan. Document your class
with javadoc.
Part 3:
The file SimpleUI.java contains a skeleton for a very simple menu-driven
user interface. In this part of the project, you'll rebuild SimpleUI
to provide these operations on a student collection:
-
add a student to the course
-
delete a student from the course
-
find and display a student whose ID the user enters
-
enter a test score for a given student
-
display all the students in the course
As each operation is carried out, make sure you inform the user whether
or not the operation succeeds.
What to submit
You must follow the process given in Systematic
Software Development and the sample project packet distributed
in class.
Your grade will be calculated on a 20-point basis, as follows:
-
6 points -- analysis and design (including relevant algorithms in structured
English), including javadoc pages
-
4 points -- test plans for both parts
-
6 points -- correct execution of both parts according to test plans
-
4 points -- layout and style of program source code
Extra credit:
No framework bonus for this project. You have 2 calendar weeks to complete
it; if you manage your time properly, you won't be crashing the deadline.
MBF 4/9/03