var Rate_Calculator = (function () {
function Rate_Calculator() { }
Rate_Calculator.prototype.RateCalculate = function (amount, rate) {
var interest, total;
interest = amount * (rate / 100);
total = amount + interest;
var div = document.getElementById("Display1");
div.innerText = "Amount ->" + amount + "\n" + "Interest -> " + rate + "%" + "\n" + "Interest paid -> " + interest + "\n" + "Total(A+IP) -> " + total;
};
return Rate_Calculator;
})();
window.onload = function () {
var obj = new Rate_Calculator();
var bttn = document.getElementById("Calculate");
bttn.onclick = function () {
var amount = (document.getElementById("Amount")).value;
var rate = (document.getElementById("Rate")).value;
if(amount.length == 0 || rate.length == 0) {
var div = document.getElementById("Display");
div.innerText = "All Fields are required";
} else {
var amount1 = parseInt(amount);
var rate1 = parseInt(rate);
obj.RateCalculate(amount1, rate1);
}
};
};
//@ sourceMappingURL=app.js.map
|