Adding programming exercise 7
solution to ex7