-
Notifications
You must be signed in to change notification settings - Fork 0
/
grade.php
109 lines (91 loc) · 1.1 KB
/
grade.php
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
function eighty($x)
{
# code...
if(is_numeric($x)){
$res = ($x/80)*100;
return(grade($res));
}
else
{
return "-";
}
}
function twenty($x){
if(is_numeric($x)){
$res = ($x/20)*100;
return(grade($res));
}
else
{
return "-";
}
}
function twentyfive($x){
if(is_numeric($x)){
$res = ($x/25)*100;
return(grade($res));
}
else
{
return "-";
}
}
function hundred($x){
if(is_numeric($x)){
$res = $x;
return(grade($res));
}
else
{
return "-";
}
}
function grade($res){
if ($res >=80 ) {
# code...
return "O";
}
elseif ($res<80 && $res>=75) {
# code...
return "A";
}
elseif ($res<75 && $res>=70) {
# code...
return "B";
}
elseif ($res<70 && $res>=60) {
# code...
return "C";
}
elseif ($res<60 && $res>=50) {
# code...
return "D";
}
elseif ($res<50 && $res>=45) {
# code...
return "E";
}
elseif ($res<45 && $res>=40) {
# code...
return "P";
}
elseif($res<40){
return "F";
}
else{
return "-";
}
}
?>
<!-- denominators to be taken
20 ia
25 tw,op,oral
theory:
40
50
60
75
80
100
-->