Compounding Table

Introduction

In this assignment you will practice:

Problem Description

You are curious about the future value of an investment given an initial deposit and compounding periodic interest rate.

Solution Description

Write a script called compounding_interest.py that takes three command line arguments, an initial deposit, a periodic interest rate, and a number of periods, and prints a table of the value of the deposit amount over time assuming compounding interest and no withdrawals. Use the following formula for the deposit amount:

$$ a = p(1 + r)^n $$

where

Period is abstract, and the interest rate is assumed to be for the period. For example, if you want to see a yearly table for 5 years with an annual interest of 6% and an initial deposit of 100 you would use the following command-line script invocation and get the following output:

❯ python3 compounding_interest.py 100 .06 5
Period          Amount
------          ------
0               100.00
1               106.00
2               112.36
3               119.10
4               126.25
5               133.82