Yearly Savings

Write a program that asks a user how much money they want to save each month and the percentage of their savings account. The program should then calculate how much money the user has saved in a year, and then add on the interest they have earned. The final balance after a year should then be displayed to the user.

How will you save per month? £ 100
What is the interest rate? 0.05
After 12 months you would have saved £1260.
get monthly savings from user
get interest rate from user
calculate annual savings by multiplying monthly savings by 12
calculate total savings by multiplying annual savings by interest rate
print out total savings
monthly_savings = int(input("How much would you save per month? £ "))
interest_rate = float(input("What is your interest rate? "))

annual_savings = monthly_savings * 12
interest = annual_savings * interest_rate
total_savings = annual_savings + interest

print("After 12 months you would have saved £", total_savings)
# Get the monthly savings from the user as integer
monthly_savings = int(input("How much would you save per month? £ "))

# Get the interest rate from the user as float
interest_rate = float(input("What is your interest rate? "))

# Calculate how much money the user adds to their account over a year
annual_savings = monthly_savings * 12

# How much interest has been generated over a year
interest = annual savings * interest_rate

#Add the interest to the total money saved over a year
total_savings = annual_savings + interest</pre>
<pre># Display how much is saved after a year
print("After 12 months you would have saved £", total_savings)

Extension

Change the code to allow a user to enter an initial lump sum on the first month.

How much would you like to save on the first month? £ 500
How will you save per month after that? £ 100
What is the interest rate? 0.05
After 12 months you would have saved £1680.

Target

You should be able to use Inputs and Outputs to solve a problem.