Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Procedure Subprogram Help 3
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SucreTeen123




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: