Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment we are going to determine how long it will take you to save enough money to make the down payment given the
In this assignment we are going to determine how long it will take you to save enough money to
make the down payment given the following assumptions:
Call the cost of your first home totalcost
Call the portion of the cost needed for a down payment portiondownpayment. For
simplicity, assume that portiondownpayment
Call the amount that you have saved thus far currentsavings. You start with a
current savings of $
Assume that you invest your current savings wisely, with an annual return of in other
words, at the end of each month, you receive an additional currentsavings
funds to put into your savings the is because is an annual rate Assume that your
investments earn a return of
Assume your annual salary is annualsalary.
Assume you are going to dedicate a certain amount of your salary each month to saving
for the down payment. Call that portionsaved. This variable should be in decimal
form ie for
At the end of each month, your savings will be increased by the return on your
investment, plus a percentage of your monthly salary annual salary
Write a program to calculate how many months it will take you to save up enough money for a
down payment.Test Case portionsaved
totalcost
totalmonths calculatemonthsannualsalary, portionsaved,
totalcost
printNumber of months:", totalmonthsOutput:
Number of months:
Test Case portionsaved
totalcost
totalmonths calculatemonthsannualsalary, portionsaved,
totalcost
printNumber of months:", totalmonthsOutput:
Number of months:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started