-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGradeProgramRemark.java
More file actions
36 lines (29 loc) · 1.12 KB
/
GradeProgramRemark.java
File metadata and controls
36 lines (29 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.util.Scanner;
public class GradeProgramRemark {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your grade (A, B, C, D, or F): ");
char grade = scanner.next().charAt(0);
grade = Character.toUpperCase(grade);
switch(grade) {
case 'A':
System.out.println("Excellent! Keep up the goal.");
break;
case 'B':
System.out.println("Very good! You're can reach the stars.");
break;
case 'C':
System.out.println("Good, but more work and you will be great soon.");
break;
case 'D':
System.out.println("You passed, but need to grind harder.");
break;
case 'F':
System.out.println("Sorry, you failed. Please try again.");
break;
default:
System.out.println("Invalid grade entered. Please enter A, B, C, D, or F.");
}
scanner.close();
}
}