Hi I have Turbo pascal and my teacher told us to find how much a guy will earn if he puts in a hundread dollars a month till he's sixty at 5 percent interest. (compound interest that is)
Help me please, Here's the code:=
Program retirement_fund (input,output);
USES winCRT;
VAR
interest:real;
fname,lname,sex:string;
age,counter,rage,rage2:integer;
Procedure cal (Var counter,rage2,rage:integer);
Begin
rage2:=60-age;
rage:=rage2*12*100;
interest:=(5/100*rage)+rage;
writeln (fname,' ',lname,' ',age,' years old ', 'will recieve a payment of ',interest:0:2,' when age 60 ');
End;
Begin
writeln ('Enter first name: ');
readln (fname);
clrscr;
writeln ('Enter second name ');
readln (lname);
clrscr;
writeln ('Enter sex ');
readln (sex);
clrscr;
writeln ('Enter age ');
readln (age);
cal (counter,rage2,rage);
cal2 (interest);
End.