Want to see what people are talking about? See the latest forum posts.

View \AMORT1.PAS

Getting Started with the Pascal tutorial, source

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


program Amortization_Table;

var Month : 1..12;
    Starting_Month : 1..12;
    Balance : real;

procedure Initialize_Data;
begin
   Balance := 2500.0;
   Starting_Month := 5;
end;

procedure Print_Annual_Header;
begin
   Writeln('Annual header');
end;

procedure Calculate_And_Print;
begin
   Balance := Balance - 100.0;
   Writeln('The balance is ',Balance:8:2,' month ',Month:3);
end;

procedure Print_Annual_Summary;
begin
end;

begin
   Initialize_Data;
   repeat
     Print_Annual_Header;
     for Month := Starting_Month to 12 do begin
       Calculate_And_Print;
     end;
     Print_Annual_Summary;
     Starting_Month := 1;
   until Balance <= 0.0;
end. (* of main program *)

corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.