Search for question
Question

Part II. Conditional Test in Java Using "IF-THEN" Copy and paste the code below into the test compiler. Run the code and take a screenshot of the results.( in MS word) Then, change the "marks" value (the student's percentage) to a score that will result in a different grade. Rerun the program, showing the different grades. Take a screenshot of the results: public class IfElselfExample { public static void main(String[] args) { // Input the student's grade ("marks") below.// int marks=65; // Program to determine what grade matches the score input above.// if(marks<50) { System.out.println("fail"); } else if(marks>=50 && marks<60) } System.out.println("D grade"); } else if(marks>=60 && marks<70) { System.out.println("C grade"); }/n} else if(marks>=70 && marks<80) { System.out.println("B grade"); } else if(marks>=80 && marks<90) } System.out.println("A grade"); } else if(marks>=90 && marks<100) { System.out.println("A+ grade"); } else } { System.out.println("Input number is not a valid grade."); }

Fig: 1

Fig: 2