Answer to the Programming Assigment 2