must be done using a while loop with nested statements Write a Python program that calculates the value of an investment with interest compounding annually. The program should allow the user to enter the beginning balance and the interest rate. This interest rate should be entered as a decimal number. For example, it should be entered as .05, instead of 5%. The program should output a table of the balance for each year. It should stop when the balance has tripled. It should also display when the balance has doubled. Be sure to right-align and format the year and balance numbers as shown in the samples below. Also, don’t forget to include your header and step comments in your code. Your program should function like this … Sample 1

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter4: Analyzing And Charting Financial Data
Section: Chapter Questions
Problem 4.6CP
icon
Related questions
Question
100%

** must be done using a while loop with nested statements

Write a Python program that calculates the value of an investment with interest compounding annually. The program
should allow the user to enter the beginning balance and the interest rate. This interest rate should be entered as a
decimal number. For example, it should be entered as .05, instead of 5%. The program should output a table of the
balance for each year. It should stop when the balance has tripled. It should also display when the balance has doubled.
Be sure to right-align and format the year and balance numbers as shown in the samples below. Also, don’t forget to
include your header and step comments in your code.
Your program should function like this …
Sample 1

Sample 2:
Enter the beginning balance: 3000
Enter the interest rate (such as .045) : .05
Year
Current Balance
3,150.00
3,307.50
3,472.88
3,646.52
3,828.84
4,020.29
4,221.30
4,432.37
4,653.98
4,886.68
5,131.02
5,387.57
5,656.95
5,939.79
6,236.78
1
2
3
4
5
6
7
8.
9.
10
11
12
13
14
15
The beginning balance doubled in 15 years.
6,548.62
6,876.05
7,219.86
16
17
18
19
7,580.85
20
7,959.89
21
8,357.89
22
8,775.78
23
9,214.57
The beginning balance tripled in 23 years.
Transcribed Image Text:Sample 2: Enter the beginning balance: 3000 Enter the interest rate (such as .045) : .05 Year Current Balance 3,150.00 3,307.50 3,472.88 3,646.52 3,828.84 4,020.29 4,221.30 4,432.37 4,653.98 4,886.68 5,131.02 5,387.57 5,656.95 5,939.79 6,236.78 1 2 3 4 5 6 7 8. 9. 10 11 12 13 14 15 The beginning balance doubled in 15 years. 6,548.62 6,876.05 7,219.86 16 17 18 19 7,580.85 20 7,959.89 21 8,357.89 22 8,775.78 23 9,214.57 The beginning balance tripled in 23 years.
Sample 1:
Enter the beginning balance: 5000
Enter the interest rate (such as .045): .075
Year
Current Balance
1
5,375.00
5,778.12
6,211.48
ו35 . ר67 ,6
7,178.15
7,716.51
8,295.25
8,917.39
9, 586.19
10,305.16
2
3
4
5
6.
9
10
The beginning balance doubled in 10 years.
11,078.04
11,908.90
12,802.07
13,762.22
14,794.39
15,903.97
11
12
13
14
15
16
The beginning balance tripled in l6 years.
Transcribed Image Text:Sample 1: Enter the beginning balance: 5000 Enter the interest rate (such as .045): .075 Year Current Balance 1 5,375.00 5,778.12 6,211.48 ו35 . ר67 ,6 7,178.15 7,716.51 8,295.25 8,917.39 9, 586.19 10,305.16 2 3 4 5 6. 9 10 The beginning balance doubled in 10 years. 11,078.04 11,908.90 12,802.07 13,762.22 14,794.39 15,903.97 11 12 13 14 15 16 The beginning balance tripled in l6 years.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage