- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentGrade.java
More file actions
Latest commit
34 lines (29 loc) · 726 Bytes
/
Copy pathStudentGrade.java
File metadata and controls
34 lines (29 loc) · 726 Bytes
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
/* Computer Programming 1
Student Grade
*/
importjava.io.*;
importjava.util.*;
publicclassStudentGrade
{
publicstaticvoidmain(String[] args) {
Scannerread = newScanner(System.in);
intgrade;
grade = read.nextInt(); //we get the grade from the console
//multiple conditions
//if grade is greater or equal to 60 print "Pass" else print "Fail"
if(grade >= 90){
System.out.println("A");
}elseif(grade >=80){
System.out.println("B");
}
elseif(grade >= 70){
System.out.println("D");
}
elseif(grade >= 60){
System.out.println("C");
}
else{
System.out.println("F");
}
}
}