-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathgpaconverter.html
More file actions
49 lines (42 loc) · 1.11 KB
/
gpaconverter.html
File metadata and controls
49 lines (42 loc) · 1.11 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
<!DOCTYPE html>
<html>
<head>
<title>GPA Converter</title>
</head>
<body>
<form name="CGPAvalue">
<table>
<tr>
<td>Enter your CGPA</td>
<td><input type="number" step=".01" name="cgpa" id="cgpa" value="0"></td>
<td><button onclick="gpa()">Check GPA</button></td>
</tr>
</table>
</form>
<script>
function gpa() {
var y = "";
var x = document.CGPAvalue.cgpa.value;
if (x > 8.5)
y = ">3.7";
if (x < 8.4 && x > 8.0)
y = "3.7"
if (x < 7.9 && x > 7.5)
y = "3.3";
if (x < 7.4 && x > 7.0)
y = "3.0";
if (x < 6.9 && x > 6.5)
y = "2.7";
if (x < 6.4 && x > 6.0)
y = "2.3";
if (x < 5.9 && x > 5.5)
y = "2.0";
if (x < 5.4 && x > 5.0)
y = "1.7";
if (x < 5.0)
y = "0 - 1.3";
alert('Your expected GPA is ' + y);
}
</script>
</body>
</html>