CS 2401 Quiz #5

Date: Tuesday, March 8, 2011.

1. Are the following topics covered in the chapter that you were supposed to read for today's class? mark Y (yes) or N (no) for each topic:

2. To increase the amount of savings, many people hire professionals to handle their retirement money. When you hire a professional, your amount grows faster, but you also have to pay a certain yearly amount to this professional. Let us assume that the amount increases by 10%, but you have to pay $100 every year. As a result, if at the previous year i -1, you had amount Ai-1, then next year, you will have Ai = 1.1 * Ai-1 - 100. Write a recursive method that, given an amount A0 at year 0 and a year n, computes how much money you will have in your retirement find by this year. Trace your method on the example of A0 = 2000 and n = 2. Hint: this problem is similar to Fibonacci numbers.