Class QuizList

java.lang.Object
  extended by QuizList

public class QuizList
extends java.lang.Object

Class that stores and manipulates a list of quiz grades.

Version:
3/24/17
Author:
Dave Reed

Constructor Summary
QuizList(java.lang.String fileName)
          Constructs a QuizList object, with quizzes read in from a file.
 
Method Summary
 Quiz getLowestGrade()
          Finds the quiz with the lowest percentage (or null if no quizzes are stored).
 double getPercentage()
          Calculates the overall percentage of all of the quizzes, with the lowest quiz dropped (assuming there are at least two quizzes).
 int numQuizzes()
          Reports the number of quiz grades that are currently stored.
 void showGrades()
          Displays all of the quiz grades, one per line, followed by the overall percentage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuizList

public QuizList(java.lang.String fileName)
Constructs a QuizList object, with quizzes read in from a file. Note that if more than one quiz grade is entered for the same date, only the last one entered should be stored.

Parameters:
filename - the name of the quiz file
Method Detail

getLowestGrade

public Quiz getLowestGrade()
Finds the quiz with the lowest percentage (or null if no quizzes are stored).

Returns:
the quiz with lowest percentage (or null)

getPercentage

public double getPercentage()
Calculates the overall percentage of all of the quizzes, with the lowest quiz dropped (assuming there are at least two quizzes).


numQuizzes

public int numQuizzes()
Reports the number of quiz grades that are currently stored.

Returns:
the number of stored quiz grades

showGrades

public void showGrades()
Displays all of the quiz grades, one per line, followed by the overall percentage.