CS111 Lab 3 Solutions
The purpose of this lab was to practice the concepts of
Divide, Conquer, and Glue (DCG). We start from simple patterns
and work up to more complex ones. We practice writing methods that use
parameters and return Picture objects.
The Divide, Conquer, and Glue approach to problem solving involves three steps (duh!)
- Divide We divide the problem into smaller manageable subproblems.
- Conquer We conquer each subproblem by applying DCG again until we can solve it easily.
- Glue We glue together the solutions to the subproblems to form the solution to the overall problem.
To practice these concepts, the lab involved programming the following patterns in PictureWorld.
 |
 |
 |
| checkerboard |
frame |
colors |
You may find it helpful to refer to the following two contracts:
Solutions
The solution code for this lab is available off of nike.wellesley.edu.
Download the CS111Lab3_Solutions folder in the /usr/users/cs111/download/labs_morning directory. However, you are strongly advised to read the solution explanations on these web pages and not only look at the code.