Question

Savings Exercise The idea here is to see how many years it will take a bank account to grow to at least a given value, assuming a fixed annual interest. Write a program savings.py. Prompts the user for three numbers: an initial balance, the annual 3.3. While Statements 145 Hands-on Python Tutorial, Release 1.0 for Python Version 3.1+ percentage for interest as a decimal. like .04 for 4%, and the final balance desired. Print the initial balance, and the balance each year until the desired amount is reached. Round displayed amounts to two decimal places, as usual The math: The amount next year is the amount now times (1 + interest fraction), so if I have $500 now and the interest rate is.04, I have $5001.04) $520 after one year and after two years I have, $520* (1.04) $540.80. If I enter into the program a S500 starting balance, 04 interest rate and a target of S550, the program prints: 500.00 520.00 540.80 562.43

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION:

Python Program:
"""
Python program that calculates the years it will take a bank account to grow to at least a given value
"""
# Reading Starting balance
initialBalance = float(input("\n Enter Starting Balance: $"));
# Reading Annual interest rate
intRate = float(input("\n Enter Annual Interest Rate: "));
# Reading Desired Final balance
finalBalance = float(input("\n Enter Desired Final Balance: $"));
# Initially set new balance to initial balance
newBalance = initialBalance;
# For handling year
year = 1;
# Printing initial balance
print("\n\n Starting Balance: %.2f \n" %(initialBalance));
# Iterate till desired balance is reached
while (newBalance <= finalBalance):
# Calculating new balance
newBalance = newBalance + (newBalance * intRate);
# Printing year wise balance
print("\n Year: %d \t Balance: $%.2f " %(year, newBalance));
# Incrementing year
year = year + 1;
print("\n\n");

SIMPLE OUTPUT:

Add a comment
Know the answer?
Add Answer to:
Savings Exercise The idea here is to see how many years it will take a bank...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Future 0.23 Suppose that you deposit $1,000 into a savings account that pays 8 percent. a If the bank compounds int...

    Future 0.23 Suppose that you deposit $1,000 into a savings account that pays 8 percent. a If the bank compounds interest annually, how much will you have in your account in four years? b. What would your balance be in four years if the bank used quarterly com- pounding rather than annual compounding? C. Suppose you deposited the $1,000 in four payments of $250 each year beginning one year from now. How much would you have in your account after...

  • I have no idea about how to write a balance sheet at all. thank you! Take...

    I have no idea about how to write a balance sheet at all. thank you! Take the following information on a company, and say what assets the company has and where the money came from to own those assets (its liabilities and equity) at the end of two years of operation (assume the principal repayment of debt has been made for year 2): The company has gross sales of $48 million per year, and the pattern of sales is even,...

  • 8-One year from now, you deposit $300 in a savings account. You deposit $1,800 the next...

    8-One year from now, you deposit $300 in a savings account. You deposit $1,800 the next year. Then you wait two more years (until 4 years from now) and deposit $1,000. If your account always earns 6% annual interest and you make no withdrawals, how much will be in the account 11 years from now? 9-You deposit $5000 for 5 years at 4% annual interest. In 5 years, you add $15,000 to your account, but the rate on your account...

  • Please answer all the questions below. Questions: (a) How many years will it take an investment...

    Please answer all the questions below. Questions: (a) How many years will it take an investment of $1,000 to grow to $2,500 if the investment pays 5% p.a. compounded monthly? [2 marks] (b) A zero-coupon bond matures in 10 years. The interest is compounded semi-annually and the face value of the bond is $1,000. The market interest rate for similar bonds is 3.25%. What is the value of this bond? [3 marks] II. How many of these bonds need to...

  • O At an annual interest rate of 10 percent, about how many years will it take...

    O At an annual interest rate of 10 percent, about how many years will it take $100 to double in value? O a. 11 b.5 O 0.9 O d. 7 O é What is the future value of $800 one year from today if the interest rate is 7 percent? O a. $747.66 b. $756.00 O c. $856.00 O d. None of the above are correct to the nearest cent. When you rent a car, you might treat it with...

  • Your best friend Frank just celebrated his 30th birthday and wants to start saving for his anticipated retirement. Frank plans to retire in 35 years and believes that he will have 20 good years of ret...

    Your best friend Frank just celebrated his 30th birthday and wants to start saving for his anticipated retirement. Frank plans to retire in 35 years and believes that he will have 20 good years of retirement and believes that if he can withdraw $90,000 at the end of each year, he can enjoy his retirement. Assume that a reasonable rate of interest for Frank for all scenarios presented below is 8% per year. This is an annual rate, review each...

  • 1. How much would be in your savings account in 7 years after depositing S100 today...

    1. How much would be in your savings account in 7 years after depositing S100 today if the bank pays 5 percent interest per year? A. $135.00 B. $140.71 C. $735.00 D. $814.20 2. What is the present value of a $500 payment made in 4 years when the discount rate is 8 percent? A. S365.35 B. S367.51 C. $460.00 D. $680.24 3. What annual rate of return is earned on a $5,000 investment when it grows to $7,000 in...

  • On January 1, you plan to take a trip around the world upon graduation four years...

    On January 1, you plan to take a trip around the world upon graduation four years from now. Your grandmother wants to deposit sufficient funds for this trip in an investment account for you. On the basis of a budget, you estimate that the trip currently would cost $17,000. Being the generous and sweet lady she is, your grandmother decided to deposit $4,000 in the fund at the end of each of the next four years, starting on December 31,...

  • Consider the two savings plans below. Compare the balances in each plan after 6 years Which...

    Consider the two savings plans below. Compare the balances in each plan after 6 years Which person deposited more money in the plan? Which of the two investment strategies is better? Yolanda deposits $550 per month in an account with an APR of 3%, while Zach deposits $7000 at the end of each year in an account with an APR of 3.5% The balance in Yolanda's saving plan after 6 years was $ (Round the final answer to the nearest...

  • 1) How long will it take for $12,000 to become $24,000, if it is in an...

    1) How long will it take for $12,000 to become $24,000, if it is in an account paying 3% every six months? 2) A department store charges its customers 1.75% per month for their credit purchases. What nominal interest rate are customers charged? What is the effective rate? 3) You deposit $2,000 in a bank that pays 3% compounded continuously. How much are you going to have at the end of 4 years? 4) A car can be purchased with...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT