Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

To be written in R code: We know that both the percentage of your salary that you save each month and the rate of salary

To be written in R code:

We know that both the percentage of your salary that you save each month and the rate of salary raise every 4 months affects how long it take to save for a down payment. Now, suppose the raise in salary every 4 months is fixed at 0.01 and you want to set a particular goal, which is to be able to afford the down payment in five years for a house.

How much should you save each month to achieve the goal? In this problem, you are going to write a function, called F3, which helps to answer that question. F3 has two arguments, price and salary. You are now going to find the best proportion of savings monthly from your salary to achieve a down payment in five years. Since hitting this exactly is a challenge, we simply want the total savings to be at least the same as the required down payment. The proportion of saving should be of 2 decimal places. Run function F3 and report the answers obtained for two cases: (salary = $7,000 and price = $1,200,000) and (salary = $4,000, price = $800,000).

Hint: while loop and if statements

Fixed values:

cost = price * 0.25 # down payment amount

r= 0.02 #percentage of monthly return from investment

saved <- 10000 # savings given by parents initially

Variable values:

salary, price,

portion_save (what we want to find the value of)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions