-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathgpa1.html
More file actions
60 lines (55 loc) · 1.94 KB
/
gpa1.html
File metadata and controls
60 lines (55 loc) · 1.94 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
56
57
58
59
60
<html>
<head>
<link rel="stylesheet" href="style_git.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css">
<title>GPA Converter</title>
<nav class="navbar navbar-light bg-success" >
<a class='navbar-brand' href='#'><i class="fa fa-calculator fa-2x"></i></a>
<span class="nav-title mr-auto mb-0 h1" style='color: white;text-align: center; font-family: "Courier New", Courier, monospace;'>Gpa Calculator</span>
</nav>
</head>
<br><br>
<body style="background: #c6e4a3;text-align: center;">
<form name="CGPAvalue">
<table class="container">
<tr class="row justify-content-center">
<td>Enter your CGPA</td>
<td><input type="number" step=".01" name="cgpa" id="cgpa" value="0"></td>
<td><button onclick="gpa()" class="gpa_submit_button">Check GPA</button></td>
</tr>
</table>
</form>
<div class="container">
<a href='index.html'><button class="back_to_home">Back to Homepage</button></a>
</div>
<script>
function gpa() {
var y = "";
var x = document.CGPAvalue.cgpa.value;
if (x >= 8.5)
y = "4"
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 <= 4.9 && x >= 4.5)
y = "1.3";
if (x <= 4.4 && x >= 4.0)
y="1.0";
if (x <= 3.9 && x >= 0.0)
y='0';
alert('Your expected GPA is ' + y);
}
</script>
</body>
</html>