Question

In: Computer Science

You are a personal financial advisor and you frequently need to tell individuals how many years...

You are a personal financial advisor and you frequently need to tell individuals how many years it will take them to reach their retirement goals given their returns on their various accounts. You plan to write a Python program that helps you calculate these returns.

You must take in three pieces of input:

  • Starting balance amount as an integer or float (how much money you wish to start a savings/market account with)
  • The APR as a float (the percentage return as a decimal, i.e. 0.04 for 4 percent)
  • The goal as an integer or float (this is basically the amount of money we want to reach before stopping)

Given those inputs above, we need to write a loop (we don't know how many iterations) that will continue to add our interest to our balance, until we've reach our goal, at which point the looping stops. We want to know how many years (iterations) it took to reach this goal, so keep track of a count each iteration of the loop.

To add interest to a balance you can think of a balance variable called b and we would use the following math:

b = b + b * apr

If the APR is a deciaml 0.04, then 100 * 0.04 becomes 4... thus our first year earned us 4 dollars making our balancing 104.

Print out the balance and the year each iteration of the loop. See the example screenshot below:

Solutions

Expert Solution

Please find below the code, code screenshots and output screenshots. Please refer to the screenshot of the code to understand the indentation of the code.  Please get back to me if you need any change in code. Else please upvote

CODE:

b = float(input("How much money you wish to start a savings/market account with: ")) #Reading the starting balance

apr = float(input("Enter Annual Percentage Return as decimal: ")) #Reading the APR

goal_amt = float(input("Enter the goal amount: ")) #Reading the goal amount

print("\nYear MoneyEarned Balance") #printing table header

year = 1 #Initialize year as 1

while b < goal_amt: #Loop untill Balance is less than goal amount

    earn = b * apr;

    b = b + earn #calculate the balance after each year

    print("{:>2d}    {:>8.2f}     {:>8.2f}".format(year, earn, b)) #displaying amount earned and balance for each year

    year = year + 1 #increment year by 1

OUTPUT:


Related Solutions

You are an investment advisor and a client asks you to tell her the chance of...
You are an investment advisor and a client asks you to tell her the chance of making money on an investment at the end of the year. You gather data on annual rates of return for the investment and find that they have a normal distribution with a mean of 5% and a standard deviation of 6%. Determine the probability that the client loses money on the investment at the end of the year, to three decimal places. Hint: If...
Suppose your financial advisor tells you that you need to save enough to draw no more...
Suppose your financial advisor tells you that you need to save enough to draw no more than 4% of your initial retirement account balance each year once you retire. You want to withdraw $50,000 per year. What balance must you achieve in your retirement account to reach your goal? Select one: a. $50,000 b. $2,000 c. $1,250,000 d. $679,516
Andrew Cousins is 63 years old and is employed as a personal tax planning advisor by...
Andrew Cousins is 63 years old and is employed as a personal tax planning advisor by PWMG LLP. Andrew is married to Ying Yue Cousins; Ying Yue is a pensions analyst at Falcons plc, a large investment bank. Andrew owns an investment portfolio of tangible and intangible assets; he is also a keen collector of antique paintings and sculptures. Andrew intends to retire in the near future; he plans to acquire a retirement home in Nice, France. To finance this...
Interview 1: Utilizing the internet, friend, relative or personal connection; find a Financial Advisor; Certified Financial...
Interview 1: Utilizing the internet, friend, relative or personal connection; find a Financial Advisor; Certified Financial Planner or someone in the Financial Services Industry. Ask for his or her assistance for the next month or week. Your assignment is to interview this person and get their opinion on the following topics. Question #5 & #6 5. What are some of the impacts of low interest rates? 6. Please pose this hypothetical question to the interviewee: " I want to buy...
Interview 1: Utilizing the internet, friend, relative or personal connection; find a Financial Advisor; Certified Financial...
Interview 1: Utilizing the internet, friend, relative or personal connection; find a Financial Advisor; Certified Financial Planner or someone in the Financial Services Industry. Ask for his or her assistance for the next month or week. Your assignment is to interview this person and get their opinion on the following topics. 1. Describe a comprehensive financial plan. 2.What steps can be taken to ensure the success of a financial plan? 3. Explain how the plan utilized the time value of...
The financial industry frequently experiences scenarios in which individuals (agents) act on behalf of an investor...
The financial industry frequently experiences scenarios in which individuals (agents) act on behalf of an investor or client (principals). The corporate form of ownership explicitly relies upon this institution with the Board of Directors and management acting on behalf of stockholders. Increasingly, many personal finance transactions also rely upon the use of intermediaries who act on behalf of customers, such as mutual fund managers, investment advisers, insurance agents, or stock traders. This relationship can create conflicts in which the agent...
Your mother and father are retired and need income to live on. The local financial advisor...
Your mother and father are retired and need income to live on. The local financial advisor offers to sell them a product that will provide them $75,000 a year for 15 years. Prevailing interest rates are 8%. The cost to purchase the product is $750,000. They asked you to evaluate the offer. Do you recommend they purchase the product? Why? If prevailing interest rates were 5%, would it change your recommendation? Why?
You are a financial advisor at a reputable bank. You are knowledgeable about the financial instruments...
You are a financial advisor at a reputable bank. You are knowledgeable about the financial instruments including stocks and bonds. A customer made an appointment with you today to seek investment advice. What questions would you ask the customer, and what advice would you offer?
You are a financial advisor at a reputable bank. You are knowledgeable about the financial instruments...
You are a financial advisor at a reputable bank. You are knowledgeable about the financial instruments including stocks and bonds. A customer made an appointment with you today to seek investment advice. What questions would you ask the customer, and what advice would you offer?
How can you tell how many different types of Carbon and Protons are present in a...
How can you tell how many different types of Carbon and Protons are present in a compound?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT