A man wants to know how much money is generated from interest on the amount he has in investment in the bank. He will decide to reinvest the interest as long as it exceeds USD 351, and in that case he wants to know how much money he will finally have in his account.
let Bank=require("./Bank").Bank;
let bank=new Bank(3569,10);
let calc=bank.interest_concept();
if(calc.interest>351)
{
console.log("The amount generated by interest is: USD "+calc.interest+" exceeds USD 351");
}
else
{
console.log("The amount generated by interest is: USD "+calc.interest+" does not exceeds USD 351");
}
console.log(" ");
console.log("The balance generated in the account is: USD "+calc.balanced_generated);