Question: Java In a course, a professor gives the following tests and assignments: - A lab activity that is observed by the teacher and assigned a

Java

In a course, a professor gives the following tests and assignments:

- A lab activity that is observed by the teacher and assigned a numerical score.

- A Pass/Fail test that has 10 questions. Minimum passing score is 70%.

- An essay that is assigned a numerical score.

- A final test that has 50 questions.

Write a class named CourseGrades. The class should have a GradedActivity array named grades as a field. The array should have four elements, one for each of the assignments previously described above. 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.

- setPassFailTest: This method should accept a PassFailTest object as its argument. This object should already hold the student's score for the Pass/Fail test. Element 1 of the grades field should reference this object.

- setEssay: This method should accept an Essay object as its argument. This object should already hold the student's score for the Essay. Element 2 of the grades field should reference this object.

- setFinalTest: This method should accept a FinalTest object as its argument. This object should already hold the student's score for the final test. Element 3 of the grades field should reference this object.

- toString: This method should return a string that contains the numerical scores and grades for each element in the grades array.

Demonstrate the class in the program.

***This program requires multiple class files***

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!