11.1k views
4 votes
Assume:

1. Your semi­annual raise is .07 (7%)
2. Your investments have an annual return of 0.04 (4%)
3. The down payment is 0.25 (25%) of the cost of the house
4. The cost of the house that you are saving for is $1M.

You are now going to try to find the best rate of savings to achieve a down payment on a $1M house in 36 months. Since hitting this exactly is a challenge, we simply want your savings to be within $100 of the required down payment.
Write a program to calculate the best savings rate, as a function of your starting salary. You should use bisection search​to help you do this efficiently. You should keep track of the number of steps it takes your bisections search to finish.

1 Answer

5 votes

Answer:

?

Step-by-step explanation:

User Garden Li
by
3.2k points