Question: 2.2 You Trylt: Grader Create a class called Top2Grader that calculates a student's grade by averaging the student's top two highest grades. If there is





2.2 You Trylt: Grader Create a class called Top2Grader that calculates a student's grade by averaging the student's top two highest grades. If there is only one grade, then that grade should be returned. If there are no grades, then o. should be returned. Finally, your Top2Grader should override tostring so that it returns "Top2Grader'. Please refer to the class diagram below to determine how your class should be constructed: Main Grader private integer m_aryo public Grader(Integer aryt) public double calculateGradeo public Integer getGrades public String toStringo is-a Top 2 Grader is-a is-a MedianGrader CurveGrader private int m_curve public CurveGrader(Integer aryll, int curve) public double calculateGradeo public String toStringo public Median Grader(Integer aryD) public double calculateGrade public String toStringo The Main, Grader, CurverGrader, and MedianGrader classes have been provided for you and are read only. Your only task is to create the Top 2 Grader class. 299276.011062 LAB ACTIVITY 221: YouTrylt: Grader 0/10 Submission Instructions Downloadable files Main.java Grader.java CurveGrader.java MedianGrader.java Download Compile command javac Main.java Grader.java CurveGrader.java MedianGrader.java Top2Grader.java -Xlint:all -encoding utf-8 We will use this command to compile your code Upload your files below by dragging and dropping into the area or choosing a file on your hard drive. Top2Grader.java Drag file here or Choose on hard drive. Grader.java Main.java import java.util."; 1 2 4. 5 6 17 8 9 19 public class Main { public static void main(String[] args) { Main m = new Main(); m.go(); } private void go() { List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
