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
        Writeln('Please enter the annual interest rate for your savings
certificate');
        Readln(AIR);
        Writeln('Enter the investment peiod for your certificate');
        Readln(period);
        Writeln('Enter the amount of your deposite');
        Readln(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: ');
        READ (rate);
        WRITE ('Time: ');
        READLN (time);
        WRITE ('Amount: ');
        READLN (cap_0);

        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  
 
 [ 2 post ] 

 Relevant Pages 

1. how to make multiple read outs - help

2. Doing an action on multiple records

3. Reading and Making GIF files

4. Table jumps outs edit mode newby

5. reading multiple numbers on one line.

6. Reading a text file backwards--Can it be done?

7. Anyone done D2->ODBC->Personal Oracle?

8. blank screen when doing graphics in tp for dos 7

9. What am I doing wrong...

10. Anyone doing 3-tier (n-tier) Client Server???

11. checking for correct data entry or preventing that it can be done

12. Can this be Done?

 

 
Powered by phpBB® Forum Software