programming assignment two implementation for Programming in R, with unit test inline.