Class 4 Objectives


At the end of today's class you should

KNOW:

BE ABLE TO:

Vocabulary: compound data, struct, field, constructor, selector, predicate, stub

Sample Exam Question:

Write a data definition for a baseball player. Your definition should record the player's name, batting average (a number usually in the range of 0.150 - 0.350), number of homeruns, number of runs batted in, and the player's position in the field (some examples of field positions are "first base", "center field", "pitcher"). Give two examples of baseball players. Finally, write a function worth-a-million that returns true if a given player has more than 20 homeruns, more than 100 RBI's, and an average above .280. Make sure you write a signature and purpose for your function.