SDSU CS535 Object-Oriented Programming & Design
Fall Semester, 1996
Programming Assignment 2

[To Assignment Index]
San Diego State University -- This page last updated Oct 3, 1996
----------

CS 535Programming Assignment 2 Due Tuesday, Oct. 15

Note: Each class you write must be in its own file. Turn in your source code and output from the tests. Don't forget your log. Be kind to the grader. Make the log sheet the first page of your assignment and make sure your name is on the first page.

1) Implement and test a key-value class(es). (You may use a different name for the class(es). ) This class(es) stores keys and values. Each key has one value. Once a key and value are stored in an object, the value can be retrieved by asking for the value at the key. Assume that all keys and values are strings. A key-value object should be able to create a string of all its keys and values. From such a string, the key-value class(es), must be able to recreate the original object. For example if an object has the following key-values:
keyvalue
sammy cat
petemy bird

then the object could produce a string like:
sam:my cat\npete:my bird

The class(es) would be able to reconstruct an object that has the keys and values listed in the above table. You may assume that any separator characters you use do not occur in the keys or values. (However, the class(es) will be more useful, if you did not make that assumption.)


2) Implement and test a student record for a course. The student record for a course contains the student's first and last names, student id number, and the grades for the programs, assignments, and tests. Each graded event (programs, assignments, and tests) has a name (like program 1) and a score. The student record must be able to compute the average of the scores. Assume that all graded events have the same weight. As in part 1) of the assignment, we need to be able to convert a student record object to a string and the string back to a student record object.

3) (Just For fun) Part two of a spider. Write a program to read the lecture notes index page (http://www.eli.sdsu.edu/courses/fall96/cs535/notes/index.html) then find the address of the last set of lecture notes, then download the html for the lecture. Becareful with relative and absolute URL's. The class HttpDownloader will be useful. The documentation for the class can be found at: http://www.eli.sdsu.edu/courses/fall96/cs535/assignments/HttpDownloader.html.


----------