- Messages
- 232
- Reaction score
- 0
- Points
- 26
Write a grading program for each class with the following grading policies:
a. There are two quizzes, each graded on the basis of 10 points.
b. There is one midterm exam and one final exam, each graded on the basis of 100 points.
c. The final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%.(Do not forget to normalize the quiz scores. They should be converted to a percent before they are average in.) Any grade of 90 or more is an A, any grade of 80 or more (but less than 90 is B, any grade of 70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and any grade below 60 is an F. The program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s overall numeric score for the entire course and final letter grade.
Define and use a class for the student record. The class should have instance variables for the quizzes, midterm, final, course overall numeric score, and course final letter grade. The overall numeric score is a number in the range 0 to 100, which represents the weighted average of the student’s work. The clss should have input and output methods. The input method should not ask for the final numeric grade nor should it ask for the final letter grade. The class should have methods to compute the overall numeric grade and the final letter grade. These last two methods will be void methods that set the appropriate instance variables. Remember, one method can call another method. If you prefer, you can define a single method that sets both the overall numeric score and the final letter grade, but if you do this, use a helping method. Your program should use all the methods we discussed. Your class should have a reasonable set of accessor and mutator methods, whether or not your program uses them. You may add other methods if you wish.
a. There are two quizzes, each graded on the basis of 10 points.
b. There is one midterm exam and one final exam, each graded on the basis of 100 points.
c. The final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%.(Do not forget to normalize the quiz scores. They should be converted to a percent before they are average in.) Any grade of 90 or more is an A, any grade of 80 or more (but less than 90 is B, any grade of 70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and any grade below 60 is an F. The program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s overall numeric score for the entire course and final letter grade.
Define and use a class for the student record. The class should have instance variables for the quizzes, midterm, final, course overall numeric score, and course final letter grade. The overall numeric score is a number in the range 0 to 100, which represents the weighted average of the student’s work. The clss should have input and output methods. The input method should not ask for the final numeric grade nor should it ask for the final letter grade. The class should have methods to compute the overall numeric grade and the final letter grade. These last two methods will be void methods that set the appropriate instance variables. Remember, one method can call another method. If you prefer, you can define a single method that sets both the overall numeric score and the final letter grade, but if you do this, use a helping method. Your program should use all the methods we discussed. Your class should have a reasonable set of accessor and mutator methods, whether or not your program uses them. You may add other methods if you wish.