Completed programming Question 6.