ITEC 120
HW6: Student

Academic Integrity

Be reminded that this homework assignment must be your own work.

Objectives

After successfully completing this lab you will be able to write a class representing a student and average scores.

Assignment

Develop a class named Student which will represent a student enrolled in a course which has 9 quizzes, one midterm exam, and one final exam. Download StudentTest.java and use it to test your class. StudentTest.out contains the correct output for this test driver. You'll have to do a visual check to compare your output to this output.

Your class will have instance data for:

Your class will calculate quiz average, semester average, and the letter grade for the semester. These values are calculated every time we want to see or use them. They are not stored as instance data because we don't know if there have been changes made to any of the original scores since the last time these values have been calculated.

Your class will have the following methods:

Constructor

The constructor will have one parameter: the student's name. All the quiz scores and midterm score and exam score are initialized to zero.

setQuizScore(int quizNum, int quizScore)

This method takes a quiz number, from 1 to 9, and a score for that quiz (a number between 0 and 10), and sets the corresponding quiz score in the quiz score array. For example, if a student made a 7 on the first quiz, setQuizScore(1,7) would set the first quiz score in the array to 7.

setMidtermScore(int score)

sets the midterm score to the given score.

setFinalScore(int score)

sets the final exam score to the given score

double getQuizAve()

calculates the quiz average. The quiz average is calculated by dropping the two lowest quiz scores and averaging the rest.

double getSemesterAve()

calculates the semester average. The semester average is a weighted average: the quiz average is worth 35%, the midterm exam is worth 25%, and the final exam is worth 40%. Note that the quiz average is out of 10, and the midterm and final are out of 100, so you'll need to multiply the quiz score by 10.

char letterGrade()

calculates the semester average and returns the associated letter grade for that average.

String toString()

returns a nicely formatted String containing a grade report for this student. For example:

Grade Report for Fred Flintstone

Quiz average   :  7.571428571428571
Midterm grade  : 76
Final Exam     : 93

Semester Average : 82.7    B

 

Submit Your Assignment

Submit your Student.java file to the HW6 dropbox on D2L.