Solution coded

Coded my solution to Programming Exercise 2