Programming Assignment 2

I have written the functions and added comments