CS 1401 Assignment #7

Date Assigned: Tuesday, October 18, 2005 or Wednesday, October 19, 2005.

Due Date: correspondingly, Tuesday, October 25, 2005, or Wednesday, October 26, 2005, before the beginning of your lab section.

Goals: to practice with classes, overloading methods and handling dates.

Points: This assignment is worth a total of 20 points. No late assignments will be accepted, but credit will be given for partially completed assignments turned in on time.

Assignment: A very prominent use of computers is to maintain databases. For example, UTEP maintains all student records on databases on computers. It is a huge task to design a complete database including functionality, user interface, and considering all the security aspects. Your assignment is to design an application which implements simple student records. The steps and the desired structure are described as follows:

Step 1. Create an object-template StudentRecord class. Include the following components in the StudentRecord class:

Step 2. Create an application class, including the following tasks:

Step 3. Add the following overloaded methods and a helper method to the object-template class. A method overloads the original method if it has the same name but different types of parameters. Overloading allows different versions of method to be used for different situations.

Step 4. Add the following tasks to the application class:

For extra credit: Java provides an easy way to save and retrieve objects. Objects created in an application may be written to a file to save their current state. Afterwards, the data values may be read back in to recreate the object. This process is called serialization (translation from object to bytes in a file) and deserialization (the reverse operation). To support serialization, the object's class name must have the words "implements Serializable" following the class name to indicate that the extra functionality of the serializable interface is available for the class. The file objects used for output and input of objects are of type ObjectOutputStream and ObjectInputStream, and the associated methods are writeObject and readObject. Implement the serialization interface for the StudentRecord class, and save the current state of one of your StudentRecord objects to an output file. Read the object back in using deserialization. Refer to pp. 354-358 of the textbook for more details. Please note that you will only be given credit for the extra credit assignment if your main assignment works.

Deliverables: as announced in the labs.