Page 1 of 1

Complete the main method in Program 2 by filling in the blanks with an appropriate statement based on the output shown i

Posted: Fri May 20, 2022 12:01 pm
by answerhappygod
Complete The Main Method In Program 2 By Filling In The Blanks With An Appropriate Statement Based On The Output Shown I 1
Complete The Main Method In Program 2 By Filling In The Blanks With An Appropriate Statement Based On The Output Shown I 1 (83.24 KiB) Viewed 34 times
Complete the main method in Program 2 by filling in the blanks with an appropriate statement based on the output shown in Figure 1. The mark for Test is 30 Exercise is greater than Test Figure 1 1 1/Program 2 class MyAssessment { enum Courseworks Test (30), Quiz (15), Exercise (15); 0 0 0 0 public int mark; private Courseworks (int mark) { this.mark = mark; } } } WNE 9 10 11 12 13 14 15 16 17 18 19 20 000 class MyScore { public static void main (String[] a) { (i) (ii) System.out.println("Test is greater than Exercise"); else System.out.println("Exercise is greater than Test"); } }

(ii) if (MyAssessment.CourseWorks. Exercise.compareTo(MyAssessment.CourseWorks. Test) < 0) (ii) if (MyAssessment.CourseWorks. Test.compare To (MyAssessment.CourseWorks. Exercise) < 0) (ii) if (CourseWorks. Exercise.compareTo (CourseWorks. Test)) 0 1 (ii) if (CourseWorks. Exercise.compareTo(CourseWorks. Test) < 0) o (i) system.out.println("The mark for " + CourseWorks. Test + " is " + CourseWorks. Test.mark); 0 (ii) if (CourseWorks. Test.compareTo(CourseWorks. Exercise)) (ii) if (My Assessment.CourseWorks. Test.compareTo(MyAssessment.CourseWorks. Exercise)) (ii) if (MyAssessment.CourseWorks. Test.compareTo(My Assessment.CourseWorks.Exercise)) o (i) system.out.println("The mark for " + My Assessment.Courselorks. Test + " is " + My Assessment. Courselorks. Test.ordinal()); 0 (0) System.out.println("The mark for + My Assessment.CourseWorks. Test + " is " + My Assessment. CourseWorks. Test.mark); o(i) System.out.println("The mark for " + CourseWorks. Test + " is " + CourseWorks. Test.ordinal()); 0 (ii) if (CourseWorks. Test.compareTo(CourseWorks. Exercise) < 0)