Hello, I need some help with my code as it has 5 errors in which I do not know how to fix. My assignment has to look like this:
Here are the errors:
Here is the code:
//This line makes the button, btnPrint wait for a mouse click //ERROR 5000 IS APPARENTLY HERE
//When the button is clicked, the countNumbers function is called
btnPrint.addEventListener(MouseEvent.CLICK, countNumbers);
function countNumbers(e:MouseEvent):void
{
var Year:uint = 1;
var Amount:Number;
var Interest: Number;
var Total: Number;
var NYear: uint;
Amount = Number(txtinInvest.text);
Interest = Number(txtinRate.text);
NYear = uint(txtinYears.text);
while (Year <= NYear)
{
lblYear.text += String(Year) + "\r";
Year++;
}
do
{
lblAmount.text += Amount.toFixed(2) + "\r";
lblAmount.text += String(Amount) + "\r";
Interest /= 100 *= Amount += Amount;
}
while (1 < Amount)
while (0 < Interest)
{
lblInterest.text += Interest.toFixed(2) + "\r";
lblInterest.text += String(Interest) + "\r";
(Interest /= 100 *= Amount) += Amount *= (Interest /= 100); //ERROR 1105 IS HERE
}
while (0 < Total)
{
lblTotal.text += Total.toFixed(2); + "\r";
lblTotal.text += String(Total) + "\r";
Amount + Interest;
}
}
I got the Year column to work but not the others. Kindly edit my code to make it look like the program.