Homework programming exercises 3 and 5