-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSchoolGradingSystem.js
More file actions
60 lines (48 loc) · 1.28 KB
/
SchoolGradingSystem.js
File metadata and controls
60 lines (48 loc) · 1.28 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//Declare all that contain the different grade categories
//E.g A - 80 - 100, B - 60 - 79, C - 50 - 59, F - 0 - 50
//given this student object, your program needs to update the student's gradeCate Property
// let cate = ["A", "B", "C", "F"]
// let student1 = {
// name: "John",
// surname: "Doe",
// mark: 90,
// gradeCate: "unknown"
// }
// if (student1.mark > 80 && student1.mark < 100){
// student1.gradeCate = cate[0]
// }
// else if (student1.mark > 60 && student1.mark < 79){
// student1.gradeCate = cate[1]
// }
// else if (student1.mark > 50 && student1.mark < 59){
// student1.gradeCate = cate[2]
// }
// else if (student1.mark > 0 && student1.mark < 49){
// student1.gradeCate = cate[3]
// }
//console.log(student1)
// var num = 0;
// var sum = ++num;
// for (start = 0; start < 10; start++) {
// console.log(start)
// }
const num = [5, 2, 5, 6, 3, 5, 2, 9, 6]
const target = 9;
let count = 0;
for(let start = 0; start < num.length; start++){
count++
if (num[start] == target){
console.log("Found " + target + " at index " + start)
break;
}
else {
console.log("Not found")
}
}
let start2 = 0;
while (start2 < 10) {
console.log(start2)
start2++;
}
// console.log()
//print the student's details