YEAR AB H 2B 3B HR BB SB CS Hank Aaron 1959 629 223 46 7 39 51 8 0 1971 495 162 22 3 47 71 1 1 AB = At Bat (Chances) H = Hits = 1B + 2B + 3B + 4B 1B = singles = H - (2B+3B+HR) 2B = doubles (2 bases) 3B = triples (3 bases) HR = 4B = home runs (4 bases) BB = base on balls (walk, 1 base) SB = stolen base (1 base) CS = caught stealing Total Bases = 1B + 2*2B + 3*3B + 4*HR + SB + BB Total Average = (Total Bases) / (AB - H + CS) POORLY SPECIFIED PROBLEMS 1. Find a player's home runs for a given year from the player's record 2. Compute a player's home runs total for all the given years (can you use iteration?) 3. Compute a player's total average for a given year. 4. Compute a player's total average for all the given years. YOU ARE TO COME UP WITH QUESTIONS TO CLARIFY THESE (2 minutes) ; YEAR AB H 2B 3B HR BB SB CS (year-homers 1959 '((1959 629 223 46 7 39 51 8 0) (1971 495 162 22 3 47 71 1 1))) For 15 minutes, either in groups of 2 or alone, write solutions to problems 1-3. 1. Find a player's home runs for a given year from the player's record 2. Compute a player's home runs total for all the given years (can you use iteration?) 3. Compute a player's total average for a given year. (year-homers 1959 '((1959 629 223 46 7 39 51 8 0) (1971 495 162 22 3 47 71 1 1))) We'll select best in groups afterwards For 5 minutes, in groups of 10 or so, select the best procedures (if you have more than 1), or pool your ideas to write a solution (if you have 0), or discuss how you arrived at a solution (if you have just 1) If time select worst of complete Each group sends a representative to a conference in back. Conference puts top 3 programs for 1, put those on board, while selecting top 3 for 2 Others work on problem 4 and listen to discussion of problem 1