michshelly
02-01-2006, 02:33 PM
Hello,
Could someone please show me what is wrong with this code especially displaying a percentage.
function Investment() {
var startAmount = 10000; // $10 000
var AnnualInterest = startAmount % 15; // 15%
var totalSoFar = AnnualInterest * startAmount;
document.write("<p> Your total thus far ... $ " + totalSoFar + "</p>");
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
Here's the problem I am trying to solve:
Write a script that calculates a !5% return on an investment of $10 000. Calculate the number of years required for a single $10 000 investment to reach $1 000 000 at an average annual return of 15%. Use a looping statement and assume that each iteration is equivalent to one year.
I haven't worked out the number of years to 1 million yet. But If you want to help with that, that would be great.
Thanks
Michelle
Could someone please show me what is wrong with this code especially displaying a percentage.
function Investment() {
var startAmount = 10000; // $10 000
var AnnualInterest = startAmount % 15; // 15%
var totalSoFar = AnnualInterest * startAmount;
document.write("<p> Your total thus far ... $ " + totalSoFar + "</p>");
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
Here's the problem I am trying to solve:
Write a script that calculates a !5% return on an investment of $10 000. Calculate the number of years required for a single $10 000 investment to reach $1 000 000 at an average annual return of 15%. Use a looping statement and assume that each iteration is equivalent to one year.
I haven't worked out the number of years to 1 million yet. But If you want to help with that, that would be great.
Thanks
Michelle