-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibfungsi.php
More file actions
55 lines (52 loc) · 1.16 KB
/
Copy pathlibfungsi.php
File metadata and controls
55 lines (52 loc) · 1.16 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
<?php
// method persentase nilai akhir
function persentase($_uts, $_uas, $_tugas){
$result = (30 * (int)$_uts / 100) + (30 * (int)(int)$_uas / 100) + (30 * (int)$_tugas / 100);
return $result;
}
// method kelulusan
function kelulusan($_nilai){
if($_nilai > 55){
return "LULUS";
} else {
return "TIDAK LULUS";
}
}
// method grade nilai
function grade_nilai($_nilai){
if($_nilai > 85){
return "A";
} else if ($_nilai > 70){
return "B";
} else if ($_nilai > 56){
return "C";
} else if ($_nilai > 36){
return "D";
} else if($_nilai > 0){
return "E";
} else {
return "I";
}
}
// method predikat nilai
function predikat_nilai($_grade){
switch($_grade){
case "A":
return "Sangat Memuaskan";
break;
case "B" :
return "Memuaskan";
break;
case "C":
return "Cukup";
break;
case "D":
return "Kurang";
break;
case "E":
return "Sangat Kurang";
break;
default:
return "Predikat tidak terdefinisi";
}
}