Solution program assignment 2

This commit includes my solution to program assignment 2