how do you make multiple read outs?
Author Message
how do you make multiple read outs?

Hi,
Im very new to programming, just started a course in turbo Pascal this year,
and I was wondering if anyone could help me out. I have a program that
computes that interest rates of a savings account, it works fine,  but my
problem is I have to be able give the interest amount and account value for
each year of the period entered. So far I can only work out how to do the
initial year of investment. I can work out the calculations but as the
specific period is an input, how would I go about making a read out for each
year? I hope my question is understandable. Thanks for any advise, i really
appreciate it.

Here is what I have so far:

Program Interest_Rates (input, output);

Var
deposite, AIR, period, AIA, ACV : real;

Begin
certificate');
Writeln('Enter the investment peiod for your certificate');
Writeln('Enter the amount of your deposite');

AIA := AIR / 100 * deposite;
ACV := AIR + deposite;
Writeln('Your annual interest amount is ', AIA);
Writeln('Your annual certificate value is ', ACV);
END.

Thu, 20 Oct 2005 11:00:25 GMT
how do you make multiple read outs?
Am Sonntag, 4. Mai 2003 03:00 schrieb odub-:

Quote:
> Hi,
> Im very new to programming, just started a course in turbo pascal this
> year, and I was wondering if anyone could help me out. I have a
> program that
> computes that interest rates of a savings account, it works fine,  but
> my problem is I have to be able give the interest amount and account
> value for each year of the period entered. So far I can only work out
> how to do the initial year of investment. I can work out the
> calculations but as the specific period is an input, how would I go
> about making a read out for each year? I hope my question is
> understandable. Thanks for any advise, i really appreciate it.

> Here is what I have so far:

[snipped]

I'm not sure if this does what you want; just try it...

PROGRAM Interest_Rates (input, output);
USES Crt;
VAR     rate, cap_0, cap_end    :REAL;
Var     i, time                 :INTEGER;

BEGIN
WRITE ('Rate: ');
WRITE ('Time: ');
WRITE ('Amount: ');

cap_end := cap_0;

FOR i := 1 TO time DO
BEGIN
cap_end := cap_end * rate;
END;

WRITELN ('You get: ', cap_end:5:2)
END.

Thu, 20 Oct 2005 20:36:09 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages