R Programming A bank offers a guaranteed investment certifi

R Programming - A bank offers a guaranteed investment certificate (GIC) which pays an annual interest rate of 4% (compounded annually) if the term is 3 years or less, or 5% if the term is more than 3 years. Write a function which takes the initial investment amount, P, and the number of interest periods (i.e. years) as arguments and which returns the amount of interest earned over the term of the GIC. That is, return I , where I = P((1 + i)^n 1).

Solution

f1 <- function(P, Y) { if(Y>3) { i<-5 I<-P((1+i)^n-1) } else { i<-4 I<-P((1+i)^n-1) } return I }
R Programming - A bank offers a guaranteed investment certificate (GIC) which pays an annual interest rate of 4% (compounded annually) if the term is 3 years or

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site