Computer Science Canada

Procedure Subprogram Help 3

Author:  SucreTeen123 [ Mon Apr 09, 2012 6:32 pm ]
Post subject:  Procedure Subprogram Help 3

Okay this question I don't even understand what it's asking let alone being able to write it. I would really appreciate it if someone would explain to me what this question is asking me to do and help me with the code. Thank you very much.

Question: Write and test a procedure subprogram called inflate that, given as parameters an amount of money and a constant annual rate of inflation, will produce a list of the inflated values of the original amount at the end of each year for 10 years.

Author:  Raknarg [ Tue Apr 10, 2012 8:52 am ]
Post subject:  RE:Procedure Subprogram Help 3

ok. So lets say you started with 100 dollars, and you had an inflation rate of 10%. This is what it would look like after 3 years:

year 0 : 100$
year 1 : 110$
year 2 : 121$
year 3 : 133.1$

What it's doing is adding 10% of the money each year, as you can see with the example. In the first year, we add 10% of 100$, or 10$. The next year we add 10% of 110$, which is 11$. This means al you need is a procedure with two parameters, called time, rate and intitial (or whatever you like), a variable to keep track of the total money, and a for loop to calculate the infaltion each year.


: