a. principalAmount: The principal value deposited
b. annualInterestRate: Interest rate per year(expressed as a decimal).
c. numberOfYears: Period for which interest has to be given.
1. Calculate the total amount accumulated using the compound interest formula.
2. Do not use toFixed or round off the answer.
3. Use a while loop to calculate the total amount over the specified number of years.
4. Store the final amount in the answer variable.
principalAmount : 500$
annualInterestRate : 0.08 (8% expressed as a decimal)
numberOfYears : 5
734.66
For principalAmount = 500, annualInterestRate = 0.08, and numberOfYears = 5:
a- You must calculate the total amount accumulated based on the given attributes.
b- Store the final amount in the "answer" variable.