Answer to Question #280336 in Java | JSP | JSF for Bjoy

Question #280336

Create a program that will display the corresponding remark of a given input grade. The range of grades and its corresponding remark are given below:



Note: Use switch case statement



Range of Grades Remarks


90-10 Excellent


80-89 Good


75-7 Fair


50-74 Poor


Other grades Out-of-range



1
Expert's answer
2021-12-20T10:03:36-0500
public class main{

    // Main driver method
    public static void main(String[] args)
    {

        // Custom input string
        int marks =77;

        // Switch statement over above string
        switch (marks) {

        // Case 1
        case 80>=:

            // Print statement corresponding case
            System.out.println("excelent");

            // break keyword terminates the
            // code execution here itself
            break;

        // Case 2
        case case 80>=:

            // Print statement corresponding case
            System.out.println(" Good");
            break;

        // Case 3
        case case 80>=:

            // Print statement corresponding case
            System.out.println("Fair");
            break;

        // Case 4
        
        case case 80>=:

            // Print statement corresponding case
            System.out.println(" Poor");
                default :
                        System.out.println(" out of range");
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog