I need help writing this class:
Write a class named CourseGrades. the class should have a gradedactivity array named grades as a field. the array should have 4 elements, one for each of the assignments previously described (lab activity that is observed by the teacher and assigned a numeric score, a pass/fail exam that has 10 questions, min. passing score of 70, an essay that is assigned a numeric score, a final exam that has 50 questions.) the class should have the following methods:
setLab: this method should accept a gradedactivity object as its argument. this object should already hold the students scores for the lab act. element 0 of the grades should reference this object.
setPassFailExam: this method should accept a passfailexam object as its argument. this object should already hold the students 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 arguments. this object should already hold the students score for the essay. element 2 of the grades field should reference this object
setFinalExam: this method should accept a finalexam object as its arguement. thes object should already hold the students 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 in a program.