Answer to Question #289908 in Java | JSP | JSF for Jones

Question #289908

create a class with grade students to accept the score of a student and determine the grade thus 85-100=A+,80-84+A,75-79=B+,70-74=B,65-69=C+,60-64=C,55-59=D+,50-54=D,Below 50=f


1
Expert's answer
2022-01-23T09:40:01-0500


import java.util.*;


public class App {



	public static void main(String[] args) {
		Scanner keyBoard = new Scanner(System.in);


		System.out.print("Enter the score: ");
		int score = keyBoard.nextInt();


		// 85-100=A+,80-84+A,75-79=B+,70-74=B,65-69=C+,60-64=C,55-59=D+,50-54=D,Below
		if (score >= 85 && score <= 100) {
			System.out.println("Grade: A+");
		} else if (score >= 80 && score <= 84) {
			System.out.println("Grade: A");
		} else if (score >= 75 && score <= 79) {
			System.out.println("Grade: B+");
		} else if (score >= 70 && score <= 74) {
			System.out.println("Grade: B");
		} else if (score >= 65 && score <= 69) {
			System.out.println("Grade: C+");
		} else if (score >= 60 && score <= 64) {
			System.out.println("Grade: C");
		} else if (score >= 55 && score <= 59) {
			System.out.println("Grade: D+");
		} else if (score >= 50 && score <= 54) {
			System.out.println("Grade: D");
		} else {
			System.out.println("Grade: F");
		}


		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
APPROVED BY CLIENTS