forked from CodeChefVIT/Stocker
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
705dec6
commit 89a33a6
Showing
9 changed files
with
230 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
//----------------------------------------calculator--------------------------------------------------- | ||
var final=document.querySelector('#final-value') | ||
|
||
|
||
var slider1 = document.getElementById("investment-slider"); | ||
var output1 = document.getElementById("investment-value"); | ||
output1.value = slider1.value; | ||
|
||
slider1.oninput = function() { | ||
output1.value = slider1.value; | ||
calculate(); | ||
} | ||
var slider2= document.getElementById("returns-slider"); | ||
var output2 = document.getElementById("returns-value"); | ||
output2.value = slider2.value; | ||
slider2.oninput = function() { | ||
|
||
output2.value = this.value; | ||
calculate(); | ||
} | ||
|
||
var slider3 = document.getElementById("time-slider"); | ||
var output3 = document.getElementById("time-value"); | ||
output3.value = slider3.value; | ||
slider3.oninput = function() { | ||
|
||
output3.value = this.value; | ||
calculate(); | ||
} | ||
calculate(); | ||
function valueChanger1() | ||
{ | ||
slider1.value=output1.value; | ||
calculate(); | ||
} | ||
function valueChanger2() | ||
{ | ||
slider2.value=output2.value; | ||
calculate(); | ||
} | ||
function valueChanger3() | ||
{ | ||
slider3.value=output3.value; | ||
calculate(); | ||
} | ||
|
||
function calculate() | ||
{ | ||
var p=slider1.value; | ||
var r=slider2.value; | ||
var t=slider3.value; | ||
var total=p*Math.pow((1+(r/100)),t); | ||
total=Math.ceil(total); | ||
final.innerHTML=total; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.