Programming Exercise 6