-
Notifications
You must be signed in to change notification settings - Fork 0
/
A2q2.js
32 lines (30 loc) · 893 Bytes
/
A2q2.js
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
function findGrade(marks) {
switch (true) {
case (marks >= 90 && marks <= 100):
console.log("S grade");
break;
case (marks >= 80 && marks < 90):
console.log("A grade");
break;
case (marks >= 70 && marks < 80):
console.log("B grade");
break;
case (marks >= 60 && marks < 70):
console.log("C grade");
break;
case (marks >= 50 && marks < 60):
console.log("D grade");
break;
case (marks >= 40 && marks < 50):
console.log("E grade");
break;
case (marks >= 0 && marks < 40):
console.log("Student has failed");
break;
default:
console.log("Invalid marks");
break;
}
}
let marks = 85;
findGrade(marks);