Excerpt from Description of Exercise

Objective: To gain experience using conditionals.

The Scenario.

One thing some students have to figure out for the first time when they come to college is how to wash their own clothes. By the time many students have figured it out, all their underwear is pink and T-shirts and other light-colored items are streaked with lots of interesting colors. In the hopes of helping next year's first-year students adjust more easily to college, we would like you to write a laundry sorting simulator.

The simulator should begin with three wash baskets on the screen (for our purposes they can just be rectangles or squares). One is labeled "whites", one "darks", and the last "colors". An image showing the kind of display we have in mind appears below.

When the simulation begins, a color swatch will appear on the screen. The user ("laundry trainee") should then click in the corresponding basket. If the user is correct, the program should randomly select a new color for the next item and display it on the screen.

Handouts Describing the Exercise

Student Resources for Lab Exercise

Sample solutions