Question: I want to create a table using For loop by python. the table at beginning should input the initial capital, interest rate, year of investment.
I want to create a table using For loop by python. the table at beginning should input the initial capital, interest rate, year of investment. and compounding frequency. besides, the program also can calculate if investors withdraw their investment early. the procedure can display a 5% early withdrawal penalty and a final returns minus the penalty.
for loop only. the procedure should display a table as the example show. include the year, start balance, interest, and end balance, and calculate the new balance and interest rate in each year.
I had create a table, but it cannot display the change of start balance, interest, and end balance from second year.
thus, I want to know how to use for loop to create a table like this.

Part B Example 1: Amount of starting investment ($): 1000 Term of investment (# of years) : 5 Interest rate (%) : 2 Compounding frequency (times/year) : 12 Enter y if early termination: n year start balance interest end balance VIA WNY 1000.00 20.18 1020. 18 1020 . 18 20.59 1040.78 1040.78 21. 01 1061.78 1061.78 21.43 1083.21 1083.21 21. 86 1105.08 Part B Example 2 (Eary Withdrawal Penalty): Amount of starting investment ($): 1000 Term of investment (# of years) : 5 Interest rate (%) : 2 Compounding frequency (times/year) : 12 Enter y if early termination: y Enter early termination year #: 4 year start balance interest 1000.00 20. 18 end balance 1020. 18 1020. 18 20.59 1040 . 78 1040.78 21. 01 1061.78 1061.78 21.43 Early termination penalty = 54.16 1083 .21 Adjusted final balance (after early withdrawal penalty) = 1029.05
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
