Program4 12A Olisa Ferati
Program4 12A Olisa Ferati
Create a Java program that accepts a student's score (between 0 and 100) and outputs the
corresponding grade based on the school's grading system.
The program should prompt the user to enter a score (an integer between 0 and 100).
Based on the input score, the program will assign a grade as per the following grading system:
0 to 39 → Grade 1
40 to 54 → Grade 2
55 to 69 → Grade 3
70 to 84 → Grade 4
85 to 100 → Grade 5
import java.util.Scanner;
class Main {
} else {
int grade;
grade = 2;
grade = 3;
grade = 4;
} else {
grade = 5;
scanner.close();
}
2. Create a Java program that uses the switch statement to evaluate a given input and print an appropriate
message based on the value of that input.