Programming Assignment 2 R Code

upload the 2 functions and the example output with test cases