-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
90 lines (75 loc) · 1.88 KB
/
Copy pathindex.html
File metadata and controls
90 lines (75 loc) · 1.88 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Simple Interest Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f2f2f2;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.calculator {
background: white;
padding: 25px;
border-radius: 10px;
width: 320px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
h2 {
text-align: center;
margin-bottom: 20px;
}
input {
width: 100%;
padding: 10px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
width: 100%;
padding: 10px;
background: #007bff;
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
}
button:hover {
background: #0056b3;
}
.result {
margin-top: 15px;
font-size: 18px;
text-align: center;
color: green;
}
</style>
</head>
<body>
<div class="calculator">
<h2>Simple Interest Calculator</h2>
<input type="number" id="principal" placeholder="Enter Principal Amount">
<input type="number" id="rate" placeholder="Enter Rate of Interest">
<input type="number" id="time" placeholder="Enter Time (Years)">
<button onclick="calculateSI()">Calculate</button>
<div class="result" id="result"></div>
</div>
<script>
function calculateSI() {
let principal = document.getElementById("principal").value;
let rate = document.getElementById("rate").value;
let time = document.getElementById("time").value;
let si = (principal * rate * time) / 100;
document.getElementById("result").innerHTML =
"Simple Interest = " + si;
}
</script>
</body>
</html>