My version of ProgrammingAssignment2

This is my version of the required functions for Programming Assignment
2.