Wrong output from annual interest program
The output is the same as the number that is originally entered as input. I have no idea what I'm doing wrong here: function main() { //get the initial amount and the interest percentage var amount = parseInt(readLine(),10); var yearPercent = parseInt(readLine(),10); var loan1 = new Loan(amount, yearPercent); //output to console console.log(loan1.yearIncome); } function Loan(amount, percent) { this.amount = amount; this.yearPercent = percent; //your code goes here this.yearIncome = amount; var interestRate = new calcYearIncome(amount, percent); }; function calcYearIncome(amount, percent){ //complete the function to calculate yearly income interestRate = percent / 100; this.yearIncome = interestRate * amount; }