In this activity, students exercise their understanding of classes and objects in order to build a class that stores a set of cards. The set of cards is backed by an array, and students implement methods to add and discard cards, check the high and low ranks of the hand, and check if the hand contains a pair, a flush, or a straight. This activity is good for students that are being introduced to classes.
For more information on how this homework fits within the scope of the course, please see the following course schedule and syllabus here: (http://mathcs.pugetsound.edu/~aasmith/cs261/). Search "CardSet Object".
By putting the implementation of classes in the context of cards, with many possible applications into card games, the activity has Meaningful and Relevant Context.