-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGradeFun.java
More file actions
40 lines (33 loc) · 1.07 KB
/
Copy pathGradeFun.java
File metadata and controls
40 lines (33 loc) · 1.07 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
36
37
38
39
40
import java.util.Scanner;
public class GradeFun {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
char grade;
System.out.println("Enter a grade");
grade = keyboard.next().charAt(0);
switch(grade) {
case 'A':
case 'a':
System.out.println("Great job!");
break;
case 'B':
case 'b':
System.out.println("Good job.");
break;
case 'C':
case 'c':
System.out.println("You can do better.");
break;
case 'D':
case 'd':
System.out.println("You're getting pretty close to failing");
break;
case 'F':
case 'f':
System.out.println("You are failing the course!");
break;
default:
System.out.println("You have entered an invalid grade.");
}//end switch
}//end main
}