CSC 160 Fall 2007 - Homework 3
Assigned Sept 12, due WEDS Sept 26
Log the time you spent on this homework by creating your
own log sheet.
Read the PSP handout for Chapters 1 and 2a, given out in class on
Mon Sept 10, before class on Mon Sept 17.
Do section 1.10 in the PSP reading. (Note: When estimating
the time for the last column of the table, use your first 2 log
sheets to guide your estimate.)
Read Chapter 4 of Dr. Bloch's textbook.
Do the following box diagram exercises from Dr. Bloch's
textbook on paper:
3.4.2: Draw a box diagram to prove that (rotate-cw
calendar) is
a legal expression. Assume that calendar is already defined.
3.4.3: Draw a box diagram for each of the three expressions
in your solution to
Exercise 3.1.3 in HW2 to prove they are all legal
expressions.
4.6.2: Draw a box diagram to prove that (define tri
(triangle 15 "solid" "orange")) is a legal expression. Assuming
that
tri is not already defined.
Do the following exercises in the Interactions (and/or Definitions)
Pane of DrScheme.
Exercise 4.1.3 from Dr. Bloch's textbook.
a) Define a variable named solid-green-box whose value is a solid
green rectangle. Use a height of 20 and a width of 10.
b) Define a variable named
outline-blue-box which is what it
sounds like. Use a height of 20 and a width of 10.
For parts c-g, use only the variable names. Do not use the pictures of
the
rectangles or the expressions using the rectangle operation, or only half
credit will be given.
c) Write an
expression to put the solid box above the outline of a box.
d) Write an expression to put the solid box
on top of (not above) the outline of a box.
e) Write an expression to put the outline of
a box on top of (not
above) the solid box.
f) Write a full sentence describing why the
results of d) and e)
different. Make sure you put a semicolon at the start of that line to
comment it out.
g) Create a two by two checkerboard where the upper left and bottom right
corners have the solid box, and the upper right and lower left corners
have the outline of a box.
Exercise 4.2.1 from Dr. Bloch's textbook: Write the function
contracts for ellipse and circle only.
For each
argument, include its data type then describe what that argument is
in parentheses. (Make sure this exercise is commented out, as discussed in
Section 4.3). Note: The contract for triangle will be
given in class on Friday 9/21, so it is omitted from this exercise.
Exercise 4.4.2 from Dr.
Bloch's textbook. Note: You may use any picture of a
person's face for this question. It does not have to be the
picture in the textbook.
Submitting your Assignment
For this assignment, and all future assignments, your DrScheme files
(Definitions and Interactions) may not be submitted on paper.
Please submit your Definitions Pane and Interactions Pane (and possibly
your Log Sheet), using the Digital Dropbox in the Tools menu on
Blackboard. Be sure to include your first and
last name in the Name Box on Blackboard, and click Send File (not Add
File)!
Please submit the PSP exercise 1.10, your Box Diagrams (and possibly your
Log Sheet) on paper in
class by the due date.
The file name for the Definitions Pane needs to
be "hw3[section][LastName]Def.scm" where:
[section] is replaced by -01 for the 9am class and -02 for the 10am
class.
[LastName] is replaced with your last name.
For example, if I were submitting this
assignment and I were in the 10am class, I would name the file
"hw3-02WittensteinDef.scm".
Similarly, the file name for the Interactions Pane needs to be
"hw3[section][LastName]Int.scm", and the file name for the Log Sheet needs
to be "hw3[section][LastName].doc".
Please let me know if this is not clear or if you are unsure exactly
what filename to use. Part of your grade is using the correct filenames.
| GRADING |
| Question |
Point Value |
| 3.4.2 |
5 |
| 3.4.3 |
15 |
| 4.6.2 |
10 |
| 4.1.3 |
40 |
| 4.2.1 |
10 |
| 4.4.2 |
10 |
| PSP 1.10 |
10 |
| Log |
10 |
| Filenames |
10 |
| Total |
120 |
Last Modified: 10/14/07