Programming Exercise 7