We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent badce31 commit 57b63aeCopy full SHA for 57b63ae
script.js
@@ -1,6 +1,11 @@
1
-function compute()
2
-{
3
- p = document.getElementById("principal").value;
4
-
+function compute() {
+ const principal = document.getElementById("principal").value;
+ const rate = document.getElementById("rate").value;
+ const years = document.getElementById("years").value;
5
+
6
+ // Calculate interest
7
+ const interest = (principal * rate * years) / 100;
8
9
+ // Display the result
10
+ document.getElementById("result").textContent = interest;
11
}
0 commit comments