Question
Analyzable Interface Modify the CourseGrades class you created in Programming Challenge 5 so it implements the following interface: public interface Analyzable { double getAverage(); GradedActivity
Analyzable Interface Modify the CourseGrades class you created in Programming Challenge 5 so it implements the following interface: public interface Analyzable { double getAverage(); GradedActivity getHighest(); GradedActivity getLowest(); } The getAverage method should return the average of the numeric scores stored in the grades array. The getHighest method should return a reference to the element of the grades array that has the highest numeric score. The getLowest method should return a reference to the element of the grades array that has the lowest numeric score. Demonstrate the new methods in a complete program.
uT13 TImISsea 3. P. 700 #6 Create a CourseGradesDemo class using the SAME class code as #5: however, ALSO display the average numeric score: get the item with the highest score and lowest score. Output should be the same as #5 and ALSO include the Average, Highest, and Lowest scores. Create an Analyzable interface as shown on p. 700 in the textbook. - - Create a CourseGrades class that implements the Analyzable interface. Use the same instance variables as before in #5. Include the following methods. a) Default constructor b) setLab- stores a GradedActivity object for the lab grade setPassFailExam - stores a PassFailExam object for the pass/fail exam grade d) setEssay- stores an Essay object for the essay grade e) setFinalExam - stores a FinalExam object for the final exam grade f) getAverage - returns the average of the object's numeric scores g) getHighest - returns the GradedActivity object with the highest score h) getLowest - returns the GradedActivity object with the lowest score i) toString - returns a string representation of the object Include the GradedActivity and Essay classes from #4 and the Fina!Exam, PassFailActivity and PassFailExam classes from #5. uT13 TImISsea 3. P. 700 #6 Create a CourseGradesDemo class using the SAME class code as #5: however, ALSO display the average numeric score: get the item with the highest score and lowest score. Output should be the same as #5 and ALSO include the Average, Highest, and Lowest scores. Create an Analyzable interface as shown on p. 700 in the textbook. - - Create a CourseGrades class that implements the Analyzable interface. Use the same instance variables as before in #5. Include the following methods. a) Default constructor b) setLab- stores a GradedActivity object for the lab grade setPassFailExam - stores a PassFailExam object for the pass/fail exam grade d) setEssay- stores an Essay object for the essay grade e) setFinalExam - stores a FinalExam object for the final exam grade f) getAverage - returns the average of the object's numeric scores g) getHighest - returns the GradedActivity object with the highest score h) getLowest - returns the GradedActivity object with the lowest score i) toString - returns a string representation of the object Include the GradedActivity and Essay classes from #4 and the Fina!Exam, PassFailActivity and PassFailExam classes from #5Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started