INTRODUCTION TO
PROGRAMMING IN
C++
Assignments for
Marine Biology Case Study
Alyce Brady
Kalamazoo College
This file contains the assignments I gave from the Marine Biology Case
Study in my Winter 2000 CS 1 course at Kalamazoo College. The pace will seem
hurried to most high school teachers (and many in colleges as well),
but is necessitated by the fact that I teach CS 1 during a 10-week
quarter. I covered Part I of the Case Study from the end of 2nd Week to
the middle of 4th Week, and Part II from the middle of 6th Week to
middle of 10th Week.
The
syllabus
for the entire course is available online, as is the
course
home page.
Week 2:
- Read the first section of Part I of the Marine Biology Case Study
(pp. 6 - 8). Do the two exercises on p. 8.
Week 3:
- Read the second section of Part I of the Marine Biology Case Study
(pp. 9 - 12).
- Histogram Lab (Tuesday)
Students must be familiar with creating variables, and using if
statements and for loops. My version of the lab also requires
students to know how to create a rectangle using CMU Graphics, but
teachers are welcome to change it to use text-based histograms or
another type of graphics.
Week 4:
- Read the third section of Part I of the Marine Biology Case Study
(pp. 13 - 18).
- Histogram Programming Project
(due Tuesday)
Extension of Histogram Lab that provides practice with apvector.
Week 7:
- Read pp. 19-28 of the Marine Biology Case Study.
- Programming Project (due Tuesday)
- Do Application Exercise 6 on p. 28 of the Marine Biology Case Study.
- Run the case study program with the various input configurations
described in the text on pp. 24-27. Answer Analysis Exercises 1-5 on
p. 28.
- Read pp. 29-42 of the Marine Biology Case Study. You may find the
Object
Diagrams for the Marine Biology Case Study useful.
- On p. 42 of the Marine Biology Case Study, do Analysis Exercise 2
and Analysis Exercise 6. (Do not do the
modifications in Exercises 4 and 5, just analyze them.)
Week 8:
- Read pp. 43-48 of the Marine Biology Case Study.
Answer the "Stop and help"
question at the top of p. 44.
- Programming Project (due Tuesday)
- Do Modification Exercise 1
on p. 42 of the Marine Biology Case Study.
- Implement operator< for the Position class also. A position is
"less than" another position if it is above it (in a row with a lower
index) or if it is in the same row but to the left of it (lower column
index). Using ==, !=, and <,
implement the remaining comparison
operators.
- Do Modification Exercise 1
on p. 48 of the Marine Biology Case Study. Once you have implemented
your new FishAt function, you should modify
Display Show to call it.
For each displayable cell,
the body of the nested loops in
Show should display a fish if one occupies the
corresponding environment position and display blank spaces
otherwise.
CORRECTION:
You should use Environment FishAt and
Fish IsUndefined in Display Show, rather than
IsEmpty and FishAt. (Can you figure out why?)
Weeks 9 and 10:
- Swimmers Programming Project
(due Wednesday of Week 10)
Extension of Marine Biology Case Study. As written, this project
uses inheritance. Many of the features of this project, however,
such as Breeding, Moving, Aging and Dying, could be implemented
without inheritance, just by using Fish. Even Eating could be
implemented without inheritance, by using age to determine whether
a fish is predator or prey (e.g., fish might eat other fish only
if they are at least 2 units younger).
This page is maintained by Alyce Brady
(abrady@kzoo.edu).