Hi! Need help here.
name of borrower
interest rate (% per annum)
term of loan (years)
Name of borrower
Rebate (1% if years/term is less than 5 years)
Amount due (future value only... or if term is less than 5 years, F minus rebate)
P=present value (loan amount)
n=term of loan in years
F=future value (amount due after term)
rebate= Future value * 0.01
Amount due= if n>=5, then F, else F*0.99
//x=prompt("Enter name of borrower: ");
//alert("Name of borrower: "+x);
name=prompt("Enter name of borrower: "," ");
P=prompt("Enter loan amount: "," ");
r=prompt("Enter interest rate (% per annum): ", " ");
n=prompt("Enter term of loan (year): ", " ");
AmtDue=(n>=5)? F: F*0.99;
document.write("Name of borrower: " +name);
document.write("<br> Loan amount: PhP" +P);
document.write("<br> Interest rate: " +r +'% per annum');
document.write("<br> Term: " +n +' years <hr>');
document.write("<br> Rebate: PhP " +rebate);
document.write("<br> Amount due: PhP " +AmtDue);
I'm having problems with the solution for F(Future value)... I also used Math.pow for the exponent of 1+r which is n(term or year).When I test it with these values, it displays the wrong Rebate and Amount Due: Test Values:
loan amount(P)= 100
interest rate(r)= 5
term of loan (n)= 2
yah, that is the correct answer. Last night, when i tested the thing with the given values, it gave me a Rebate value of more than 10,000 and an Amount Due value of more than 13,000... I have no idea where those answers came from... Now, when I tested it again, the two didn't show any values anymore... And even the words weren't there anymore. It gave me only the output of:
Loan amount: 100
Interest rate: 5
it, ended there... no more rebate and amount due... even the words "Rebate:" and "Amount Due:" were no longer displayed...
I tried the r= parseInt(r); u gave but it still wouldn't show up... I didn't make any revisions last night so I'm wondering why the rebate and amount due wouldn't show up this time. What do you think is wrong? Do you have any suggestions for an alternative code?
Anyways, I tried to do the code you gave i am having a new problem. Last night I was still testing it and it was working fine except for the calculations of the Rebate and Amount Due. But just now, when i tried to test the thing again, it didn't display the Amount Due and Rebate... including the words "Rebate:" and "Amount Due:"... So even if i tried your suggested code, I still couldn't see if it fixed the math problem.
What do you think might be wrong with it?... Do you have any suggested alternative codes aside from the code I did?...
i think the loan processing system that i am doing works in a different way yours does. And i should not do any additional inputs or outputs than those stated in the requirements because it is a workshop given by our professor for school. I have no choice but to stick to the given input requirements.
But thanks for the help! I really appreciate it! Good day!
Clueful, oh yah... sorry bout that... I thought you were talking bout the coding... I just understood after reading your reply that you meant inputs...