CSC 160 Fall 2010 - Homework 3
Assigned Sept 29 & Oct 4, due WEDS Oct 6
Assigned W 9/29
Textbook Reading (to review today's class):
Read Sections 3.1-3.4 of the textbook.
Do the following exercises from the textbook in DrRacket:
Exercise 3.3.3
a) Define a variable named solid-green-box whose value is a solid
green rectangle. Use a width of 10 and a height of 20.
b) Define a variable named
outline-blue-box which is what it
sounds like. Use a width of 10 and a height of 20.
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 3.4.4:
Write the function
contracts for ellipse, circle, and
star-polygon 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 3.4.3). Note: The contract for triangle will be
given in class, so it is omitted from this exercise.
Do the following at the bottom of your Definitions pane:
Write at least one paragraph inside the symbols #| and |# summarizing
and giving your opinion of the Joys and Woes
article.
Textbook Reading (to prepare for next class):
Read Sections 3.5-3.10 and 4.1 of the textbook.
Assigned M 10/4
Textbook Reading (to review today's class):
Read Sections 3.5-3.10 of the textbook.
Do the following exercises from the textbook in DrRacket:
Exercise 3.5.4:
Hint: A circle's width and height are each twice the radius. Exercise
3.5.9:
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.
EXTRA CREDIT: Exercise 3.5.8
Do the following exercise from the textbook on paper:
3.8.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.
Textbook Reading (to prepare for next class):
Read Sections 4.1-4.2 of the textbook.
Read this Definition
of a Program.
Submitting your Assignment
Your Definitions Pane and Interactions Pane are to be submitted through
Moodle.
Be sure to include your first and
last name as a comment in the first line of your Defintions pane.
Please submit the Box Diagram on paper in class by the due date.
The file name for the Definitions Pane needs to
be "hw3[LastName]Def.rkt" where:
[LastName] is replaced with your last name.
For example, if I were submitting this
assignment, I would name the file
"hw3WittensteinDef.rkt".
Similarly, the file name for the Interactions Pane needs to be
"hw3[LastName]Int.rkt".
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.3.3 |
35 |
| 3.4.4 |
15 |
| Joys and Woes |
10 |
| 3.5.4 |
10 |
| 3.5.9 |
15 |
| 3.8.2 |
10 |
| X-CR: 3.5.8 |
10 |
| Filenames |
5 |
| Total |
100 + 10 |
Last Modified: 9/29/10