class Student { /** Record the score of a freshly-taken quiz. * @param score The score on the quiz-to-record. */ void recordQuiz( int score ) { quizzesTaken = quizzesTaken + 1; totalPoints = totalPoints + score; } /** Return this Student's average quiz score. * @return this Student's average quiz score. */ double getAverage() { if (quizzesTaken == 0) { return QUIZ_POSSIBLE_PTS; } else { return ((double)totalPoints) / ((double)quizzesTaken); } } /** Construct a new Student object, * which starts the semester with no quizzes taken. */ Student() { quizzesTaken = 0; totalPoints = 0; } static final int QUIZ_POSSIBLE_PTS = 10; int quizzesTaken; int totalPoints; }