Learn to program chap 8.3 exercises