In a course, a teacher gives the following tests and assignments:
A lab activity that is observed by the teacher and assigned a numeric score.
A pass/fail exam that has 10 questions. The minimum passing score is 70.
An essay that is assigned a numeric score.
A final exam that has 50 questions.
Write a class named CourseGrades. The class should have an array of GradedActivity object as a field. The array should be named grades. The grades array should have four elements, one for each of the assignments previously described. The class should have the following methods:
setLab: This method should accept a GradedActivity object as its argument. This object should already hold the student's score for the lab activity. Element 0 of the grades field should reference this object.
setPassFailExam: This method should accept a PassFailExam object as its argument. This object should already hold the student's score for the pass/fail exam. Element 1 of the grades field should reference this object.
setEssay: This method should accept an Essay object as its argument(Use GradedActivity object ). The Essay class extends the GradedActivity class presented in this chapter. The Essay class should determine the grade a student receives for an essay. The student's essay score can be up to 100 and is determined in the following manner: 1) Grammar: 30 points, 2) Spelling: 20 points, 3) Correct length: 20 points, and Content: 30 points. Element 2 of the grades field should reference this object.
setFinalExam: This method should accept a FinalExam object as it's argument. This object should already hold the student's score for the final exam. Element 3 of the grades field should reference this object.
toString: This method should return a string that contains the numeric scores and grades for each element in the grades array.
Demonstrate the class with a driver program.
part of the code.
1. Need to have proper design ( UML with Flowchart) with Dia app. Flowchart should be drawn for each method in UML.
2. Proper comments.
3.Proper doc-string describing each method in code.
4.Proper Documentation should be for the code.
5. with code the UML and flowcart should be matched.
This assignment has been answered 4 times in private sessions.
© 2022 Codify Tutor. All rights reserved