CSC 222: Object-Oriented Programming
Spring 2017

HW 4: Lists & Objects

In lectures, we explored an application involving a massive collection of UFO sightings. The UFOsighting class stored information about a single sighting and provided methods for accessing that information. The UFOlookup class read in the UFO sighting data from a file, constructed an ArrayList of UFOsighting objects, and then provided methods for selectively looking up sightings based on location or date. For this assignment, you will develop similar classes that store and process quiz data.

Consider a course in which quizzes may be administered on any given day, and the number of points in each quiz can vary. Furthermore, suppose the instructor is extremely forgiving and allows students to retake quizzes as many times as they like. For a given day, only the last quiz grade recorded will count. In addition, the lowest quiz grade (i.e., the quiz with lowest percentage) is dropped. Quiz grades for a given student are stored in a file, with each line specifying the quiz date, points earned and possible points for a single quiz. For example:

    2017/03/10 3 5
    2017/03/12 0 8
    2017/03/12 6 8
    2017/03/17 4 12
    2017/03/19 2 4
    2017/03/17 8 12

This data shows that four quizzes were taken, with the quizzes on 3/12 and 3/17 being taken twice (and so the first scores, 0/8 and 4/12, are discarded). The lowest remaining quiz grade is 2/4, so the overall quiz grade for this student would be (3+6+8)/(5+8+12) = 17/25 = 68.0.

In-Class Exercise (may be completed in pairs)

The Quiz class has been provided for you, which stores the basic information about a quiz. You are to make the following additions to the class:

Homework Assignment (must be completed individually)

Implement the QuizList class, whose javadoc page is provided. This class will be similar to the UFOlookup class in that it reads and stores data from a file and provides methods for accessing that data. Note the following:

Be sure to include javadoc comments in your classes, including your name in the top comment block. Avoid redundancy and be conservative in your use of fields - if a data value does not need to persist over the life of the object, declare it to be local to the method that needs it.