Question
PYTHON In the first assignment(what you had to calculate in first assignment is given after this paragraph), you explored writing the Python code for an
PYTHON
In the first assignment(what you had to calculate in first assignment is given after this paragraph), you explored writing the Python code for an arithmetic expression involving the future value of money. Given the age of the child at the start of the RESP, the monthly amount to be saved, and the annual rate of return of the investment, your program calculated the total amount of the RESP when the child reaches the age of 18. FIRST ASSIGNMENT, YOU CALCULATED: "Let us suppose little Nicky is aged 3 when an RESP is started. Let us also assume that Nicky's parents save $150 each month for the RESP, and it is invested in a security that averages 10% growth per year. (I note that there is no bank that will offer such an interest rate, but because an RESP may be invested in stocks and bonds, that 5% rate is not entirely impossible.) Furthermore:
* Our formula takes into account the **monthly** savings of $150, and so any rate calculations must divide an annual rate by 12. For our example, the rate of increase each month is ```i = 0.10 / 12```.
* As a consequence of this, we must count the number of months of savings, not just the number of years. As Nicky is 3 when the RESP starts, and will be 18 when investment ends, the number of saved months is ```n = (18 - 3) * 12```.
The formula for calculating the balance of such an investment, and assuming the investment returns are compounded monthly, can be computed as:
= *{[(1+i)^(n) -1]/i}
which means in Nicky's case the value of the RESP at age 18 would be ```$62170.55```.
Write a program that performs the RESP calculation. The program must ask the user to input the following (**and in this order**):
1. The age of the child at the start of the RESP (i.e., assume the RESP starts on the child's birthday) 1. The amount to be invested each month 1. The annual rate of return for the investment, in percent."
THIS ASSIGNMENT:
In this assignment, you will re-use that calculation(above), but now print a table showing the value of the RESP at the end of each year for which funds were saved in the RESP. That is, after asking for: * age of child at the start of the RESP * monthly contribution amount * annual rate of return of investment in percent your program will print a table for each year from the start of the RESP up to and including 18.
Using the example from assignment one (age at start: 3; monthly saving: \$150; annual rate of return: 10%), the following table would be generated by your program. ``` age RESP value 4 1884.84 5 3967.04 6 6267.27 7 8808.37 8 11615.56 9 14716.70 10 18142.56 11 21927.16 12 26108.06 13 30726.75 14 35829.07 15 41465.68 16 47692.52 17 54571.38 18 62170.55 ```
Write a program that produce this table. The program must ask the user to input the following (**and in this order**):
1. The age of the child at the start of the RESP (i.e., assume the RESP starts on the child's birthday) 1. The amount to be invested each month 1. The annual rate of return for the investment, in percent.
and after this print the table with numbers aligned as shown in the example (i.e., integers aligned as shown, and floating-point number as shown). When writing your program, you will find it easier to simply recalculate the RESP value for each year of the child's youth. (HINT: USE WHILE LOOP)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started