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

Question #282434

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-24T11:37:43-0500


import java.util.Scanner;


public class App {


	/**
	 * The start point of the program
	 * 
	 * @param args
	 * 
	 */
	public static void main(String[] args) {
		System.out.print("Enter marks: ");
		Scanner keyBoard = new Scanner(System.in);
		int grade = keyBoard.nextInt();


		switch (grade) {
		case 90:
		case 91:
		case 92:
		case 93:
		case 94:
		case 95:
		case 96:
		case 97:
		case 98:
		case 99:
		case 100:
			System.out.println("Excellent");
			break;
		case 80:
		case 81:
		case 82:
		case 83:
		case 84:
		case 85:
		case 86:
		case 87:
		case 88:
		case 89:
			System.out.println("Good");
			break;
		case 75:
		case 76:
		case 77:
		case 78:
		case 79:
			System.out.println("Fair");
			break;
		case 50:
		case 51:
		case 52:
		case 53:
		case 54:
		case 55:
		case 56:
		case 57:
		case 58:
		case 59:
		case 60:
		case 61:
		case 62:
		case 63:
		case 64:
		case 65:
		case 66:
		case 67:
		case 68:
		case 69:
		case 70:
		case 71:
		case 72:
		case 73:
		case 74:
			System.out.println("Poor");
			break;
		default:
			System.out.println("Out of range");
			break;
		}
		keyBoard.close();
	}
}

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