-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsgpa.html
163 lines (131 loc) · 4.09 KB
/
sgpa.html
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"content="width=device-height, initial-scale=1" />
<title>2021 SGPA 1st sem</title>
<script>
function calculate()
{
var a=parseInt(document.getElementById("mat").value);
var b=parseInt(document.getElementById("che").value);
var c=parseInt(document.getElementById("psp").value);
var d=parseInt(document.getElementById("eln").value);
var e=parseInt(document.getElementById("eme").value);
var f=parseInt(document.getElementById("chel").value);
var g=parseInt(document.getElementById("cpl").value);
var h=parseInt(document.getElementById("egh").value);
var i=parseInt(document.getElementById("sfh").value);
var aa=3*marks(a);
var ab=3*marks(b);
var ac=3*marks(c);
var ad=3*marks(d);
var ae=3*marks(e);
var af=1*marks(f);
var ag=1*marks(g);
var ah=2*marks(h);
var ai=1*marks(i);
var z=((aa+ab+ac+ad+ae+af+ag+ah+ai)/200)*10;
document.getElementById("res").value=parseFloat(z);
}
function marks(y)
{
if(y>=90)
return 10;
else if (y<=89&&y>=80)
return 9;
else if (y<=79&&y>=70)
return 8;
else if (y<=69&&y>=60)
return 7;
else if (y<=59&&y>=50)
return 6;
else if (y<=49&&y>=45)
return 5;
else if (y<=44&&y>=40)
return 4;
else
return 0;
}
</script>
<style>
#calc {
background-color: aqua;
padding: 0.5% 2% 0.5% 2%;
font-size: 100%;
}
label{
color: aliceblue;
margin-top: 5%;
font-weight: bold;
}
input{
background-color: rgb(221, 239, 137);
margin: 1% 0 2% 0 ;
font-weight: bold;
text-align: center;
font-size: 100%;
}
*{
background-color: rgb(5, 13, 76);
}
#res{
font-size: 200%;
width: 150px;
background-color: rgb(217, 237, 198);
color: red;
}
#h{
color: red;
font-size: x-large;
margin-bottom: 7%;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}
</style>
</head>
<center>
<body id="bd">
<b id="h">2021 SGPA CALCULATOR</b>
<br>
<br>
<label>21MAT11 : </label>
<br>
<input type="text" id="mat">
</br>
<label>21CHE12/21PHY12 : </label>
</br>
<input type="text" id="che">
</br>
<label>21PSP13/ 21ELE13 : </label>
</br>
<input type="text" id="psp">
</br>
<label>21ELN14/21CIV14 : </label>
<br>
<input type="text" id="eln">
</br>
<label>21EME15/21EVNL15 : </label>
<br>
<input type="text" id="eme">
</br>
<label>21CHEL16/21PHYL16: </label>
<br>
<input type="text" id="chel">
</br>
<label>21CPL17/21ELEL17 : </label>
<br>
<input type="text" id="cpl">
</br>
<label>21EGH18 : </label>
<br>
<input type="text" id="egh">
</br>
<label>21SFH19/21IDT19 : </label>
<br>
<input type="text" id="sfh">
</br>
<input type="button" value="calculate" id="calc" onclick="calculate()"></input>
<p style="color:red; font-size:large">Your CGPA/SGPA is</p>
<input type="text" id="res" disabled>
</center>
</body>
</html>