Modify the R file and add the code implementing the two functions required
in Programming Assignment 2