-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcgpa.html
366 lines (363 loc) · 12.9 KB
/
cgpa.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap" rel="stylesheet" />
<link rel="icon" href="images/m_icon1.ico" type="image/x-icon" />
<link href="https://fonts.googleapis.com/css2?family=New+Rocker&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../Engineering-Calculator/style/style-cgpa.css" />
<title>CGPA Calculator</title>
</head>
<body>
<div class="container">
<video autoplay loop class="videoback" muted plays-inline>
<source src="../Engineering-Calculator/V2.mp4 " type=video/mp4>
</video>
<div class="header">
<h1>CGPA Calculator </h1>
</div>
<nav>
<ul>
<a href="index.html">
<li>Home </li>
</a>
<a href="sgpa.html">
<li>SGPA Calculator </li>
</a>
<a href="cgpa.html">
<li>CGPA Calculator </li>
</a>
<a href="cgpa2perc.html">
<li>CGPA Percentage </li>
</a>
</ul>
</nav>
<div class="semester">
<div class="sem">
<label for="Semester">Semester 1 :</label>
<input id="1" type="number" min="1" max="10" placeholder="1-10" />
</div>
<div class="sem">
<label for="Semester">Semester 2 :</label>
<input id="2" type="number" min="1" max="10" placeholder="1-10" />
</div>
<div class="sem">
<label for="Semester">Semester 3 :</label>
<input id="3" type="number" min="1" max="10" placeholder="1-10" />
</div>
<div class="sem">
<label for="Semester">Semester 4 :</label>
<input id="4" type="number" min="1" max="10" placeholder="1-10" />
</div>
<div class="sem">
<label for="Semester">Semester 5 :</label>
<input id="5" type="number" min="1" max="10" placeholder="1-10" />
</div>
<div class="sem">
<label for="Semester">Semester 6 :</label>
<input id="6" type="number" min="1" max="10" placeholder="1-10" />
</div>
<div class="sem">
<label for="Semester">Semester 7 :</label>
<input id="7" type="number" min="1" max="10" placeholder="1-10" />
</div>
<div class="sem">
<label for="Semester">Semester 8 :</label>
<input id="8" type="number" min="1" max="10" placeholder="1-10" />
</div>
</div>
<div class="result">
<input id="cgpa" type="number" name="cgpa" id="cgpa" placeholder="CGPA" readonly />
<input id="perc" type="number " name="perc " id="perc" placeholder="Percentage" readonly />
</div>
<div class="cal">
<button onclick="calculate()" class="button1">
<p id="a">Calculate</p>
</button>
<a href="">
<button class="button2">
<p>Reset</p>
</button>
</a>
</div>
<div class="note">
<p>Note: Leave the fields of semesters not completed as it is.</p>
</div>
<div class="footer">
<p id="by">
Handcrafted with <i class="fa fa-heart" aria-hidden="true"></i> by
<a href="https://mayurpai.github.io/" target="blank"><strong>Mayur Pai</strong></a>
</p>
<p id="copy">
Copyright <i class="fa fa-copyright" aria-hidden="true"></i> 2020
</p>
<a href="https://wa.me//919611609185"><i class="fa fa-whatsapp fa-2x" id="whatsapp" aria-hidden="true"></i></a>
<a href="https://www.facebook.com/profile.php?id=100010154376824" title="Mayur Pai" target="blank"><i
class="fa fa-facebook fa-2x" id="fb" aria-hidden="true"></i></a>
<a href="https://twitter.com/Mayur_pai5" title="Mayur_pai5" target="blank"><i class="fa fa-twitter fa-2x"
id="twitter" aria-hidden="true"></i></a>
<a href="https://www.instagram.com/mayurpai19/" title="mayurpai19" target="blank"><i class="fa fa-instagram fa-2x"
id="insta" aria-hidden="true"></i></a>
<a href="https://www.linkedin.com/in/mayur-pai5/" title="Mayur Pai B H" target="blank"><i
class="fa fa-linkedin fa-2x" id="link" aria-hidden="true"></i></a>
<a href="https://github.com/mayurpai" title="Mayur Pai" target="blank"><i class="fa fa-github fa-2x" id="git"
aria-hidden="true"></i></a>
</div>
</div>
<script>
function calculate() {
var Credit1 = 20,
Credit2 = 20,
Credit3 = 24,
Credit4 = 24,
Credit5 = 25,
Credit6 = 24,
Credit7 = 20,
Credit8 = 18;
var Subject1 = document.getElementById("1").value;
var Subject2 = document.getElementById("2").value;
var Subject3 = document.getElementById("3").value;
var Subject4 = document.getElementById("4").value;
var Subject5 = document.getElementById("5").value;
var Subject6 = document.getElementById("6").value;
var Subject7 = document.getElementById("7").value;
var Subject8 = document.getElementById("8").value;
if (
Subject1 > 0 &&
Subject1 <= 10 &&
Subject2 > 0 &&
Subject2 <= 10 &&
Subject3 > 0 &&
Subject3 <= 10 &&
Subject4 > 0 &&
Subject4 <= 10 &&
Subject5 > 0 &&
Subject5 <= 10 &&
Subject6 > 0 &&
Subject6 <= 10 &&
Subject7 > 0 &&
Subject7 <= 10 &&
Subject8 > 0 &&
Subject8 <= 10
) {
var x =
(Number(Subject1) * Number(Credit1) +
Number(Subject2) * Number(Credit2) +
Number(Subject3) * Number(Credit3) +
Number(Subject4) * Number(Credit4) +
Number(Subject5) * Number(Credit5) +
Number(Subject6) * Number(Credit6) +
Number(Subject7) * Number(Credit7) +
Number(Subject8) * Number(Credit8)) /
(Credit1 +
Credit2 +
Credit3 +
Credit4 +
Credit5 +
Credit6 +
Credit7 +
Credit8);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else if (
Subject1 > 0 &&
Subject1 <= 10 &&
Subject2 > 0 &&
Subject2 <= 10 &&
Subject3 > 0 &&
Subject3 <= 10 &&
Subject4 > 0 &&
Subject4 <= 10 &&
Subject5 > 0 &&
Subject5 <= 10 &&
Subject6 > 0 &&
Subject6 <= 10 &&
Subject7 > 0 &&
Subject7 <= 10
) {
var x =
(Number(Subject1) * Number(Credit1) +
Number(Subject2) * Number(Credit2) +
Number(Subject3) * Number(Credit3) +
Number(Subject4) * Number(Credit4) +
Number(Subject5) * Number(Credit5) +
Number(Subject6) * Number(Credit6) +
Number(Subject7) * Number(Credit7)) /
(Credit1 +
Credit2 +
Credit3 +
Credit4 +
Credit5 +
Credit6 +
Credit7);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else if (
Subject1 > 0 &&
Subject1 <= 10 &&
Subject2 > 0 &&
Subject2 <= 10 &&
Subject3 > 0 &&
Subject3 <= 10 &&
Subject4 > 0 &&
Subject4 <= 10 &&
Subject5 > 0 &&
Subject5 <= 10 &&
Subject6 > 0 &&
Subject6 <= 10
) {
var x =
(Number(Subject1) * Number(Credit1) +
Number(Subject2) * Number(Credit2) +
Number(Subject3) * Number(Credit3) +
Number(Subject4) * Number(Credit4) +
Number(Subject5) * Number(Credit5) +
Number(Subject6) * Number(Credit6)) /
(Credit1 +
Credit2 +
Credit3 +
Credit4 +
Credit5 +
Credit6);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else if (
Subject1 > 0 &&
Subject1 <= 10 &&
Subject2 > 0 &&
Subject2 <= 10 &&
Subject3 > 0 &&
Subject3 <= 10 &&
Subject4 > 0 &&
Subject4 <= 10 &&
Subject5 > 0 &&
Subject5 <= 10
) {
var x =
(Number(Subject1) * Number(Credit1) +
Number(Subject2) * Number(Credit2) +
Number(Subject3) * Number(Credit3) +
Number(Subject4) * Number(Credit4) +
Number(Subject5) * Number(Credit5)) /
(Credit1 +
Credit2 +
Credit3 +
Credit4 +
Credit5);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else if (
Subject1 > 0 &&
Subject1 <= 10 &&
Subject2 > 0 &&
Subject2 <= 10 &&
Subject3 > 0 &&
Subject3 <= 10 &&
Subject4 > 0 &&
Subject4 <= 10
) {
var x =
(Number(Subject1) * Number(Credit1) +
Number(Subject2) * Number(Credit2) +
Number(Subject3) * Number(Credit3) +
Number(Subject4) * Number(Credit4)) /
(Credit1 +
Credit2 +
Credit3 +
Credit4);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else if (
Subject1 > 0 &&
Subject1 <= 10 &&
Subject2 > 0 &&
Subject2 <= 10 &&
Subject3 > 0 &&
Subject3 <= 10
) {
var x = (Number(Subject1) * Number(Credit1) +
Number(Subject2) * Number(Credit2) +
Number(Subject3) * Number(Credit3)) /
(Credit1 +
Credit2 +
Credit3);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else if (
Subject1 > 0 &&
Subject1 <= 10 &&
Subject2 > 0 &&
Subject2 <= 10
) {
var x = (Number(Subject1) * Number(Credit1) +
Number(Subject2) * Number(Credit2)) /
(Credit1 +
Credit2);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else if (Subject1 > 0 && Subject1 <= 10) {
var x = (Number(Subject1) * Number(Credit1)) /
(Credit1);
document.getElementById("cgpa").value = x.toFixed(2);
var y = (x.toFixed(2) - 0.75) * 10;
document.getElementById("perc").value = y.toFixed(2) + " %";
setTimeout(() => {
if (confirm('Wanna Improve Your Grade?\nVisit "Tu Phodega"')) {
location.href = "https://mayurpai.github.io/TuPhodega/index.html";
}
}, 1000);
} else {
alert(
"Kindly Enter Valid Cumulative Grade Performance Average (CGPA) Score's"
);
}
}
</script>
</body>
</html>