155k views
3 votes
Design an Essay class that is derived from the GradedActivity class presented in this chapter. The Essay class should determine the grade a student receives on an essay. The student’s essay score can be up to 100, and is determined in the following manner: • Grammar: 30 points • Spelling: 20 points • Correct length: 20 points • Content: 30 points Demonstrate the class in a simple program

1 Answer

4 votes

Final answer:

The Essay class design involves computing a student's essay score from Grammar, Spelling, Correct Length, and Content categories, and is an extension of the GradedActivity class.

Step-by-step explanation:

The student's question involves designing an Essay class that is derived from the GradedActivity class. The Essay class needs to evaluate a student's essay score based on specific criteria: Grammar (30 points), Spelling (20 points), Correct Length (20 points), and Content (30 points).

To demonstrate the class, one can create a simple program that initializes an instance of the Essay class, assigns scores to each of these aspects, calculates the total score, and then determines the grade based on these scores. In implementing this class, it would be necessary to have methods within the class that allow for setting each of the component scores separately, a method to calculate the final score, and one to output the resulting grade.

User Zedfoxus
by
8.3k points

No related questions found