Please help me with the following code…

for i=1 to “No. of expected interest period” do begin

“carrying value”:=1000000;

Interest:=(“Effective Interest”*“Carrying Value”)/100;

Amortization:=“Expected Interest Amount”-Interest;

“Carrying Value”:=“Current Value”-Amortization;

end;

Having made the required definitions prior to this code i was not able to get the desired results. I expected the “carrying value” to decrement by the value of amortization and the new value is used for calculation of Interest.

please help. agent.