CS 2135: Lab 1

Lab Motivation and Goals

By the end of this lab, you should be able to:

Exercises: Getting to Know DrScheme (15-20 minutes)

Exercises: Working with Structures

In order to get more familiar with structures and data models, we are going to define data models and programs for geometric shapes on a coordinate plane. We want to start with a set of shapes containing circles and rectangles. A circle needs a center point and a radius; a rectangle needs the point at the top-left corner, a width, and a height.

DrScheme provides a built-in define-struct for coordinates:

                  (define-struct posn (x y))

Do not type this into your definitions window -- it is built in! You should use posns to capture coordinates in the following exercises.

Everybody should be able to finish up to this point

If you are doing very well with data models and programming with structs, you should be able to finish up to this point

Exercises: Working with Lists