CSC 160 Fall 2011 - Homework 9
Assigned Dec 5, due Mon Dec 12
Assigned M 12/5
Textbook Reading (to review today's class):
Read Sections 13.7-13.9 of
the textbook.
Do the following exercise in DrRacket on your own or in
pairs (using the ideas in the Pair
Programming article):
Exercise 13.7.5 from the textbook [Show ALL Design Recipe steps
including Data Analysis and 5
well-chosen examples. For full credit, you must type your
function definition from 13.3.3 in HW8 into the
Definitions Pane and
then "re-use" it in the function body to 13.7.5, using the ideas of
Chapter 11.]
Textbook Reading (to prepare for next class):
Study Chapters 11 & 13 for Wednesday's quiz!
Read Sections 15.1-15.3 of the textbook.
Assigned W 12/7
Textbook Reading (to review today's class):
Read Sections 15.1-15.3 of the textbook.
Do the following exercises in DrRacket on your own or in pairs
(using the ideas in the Pair Programming article):
Exercise 15.3.1 from the textbook
Exercise 15.3.2: Modify your solution to Exercise 15.3.1 to produce
the string "Out of stock!" if the input
isn't any of the known games (instead of the picture of a question
mark mentioned in the text). [Name this function
choose-picture-v2 so
that you do not comment out the function for 15.3.1. No need to redo the
whole Design Recipe, since you did it for 15.3.1. Just copy the examples,
change the function name to choose-picture-v2, and add a test
case or two for the condition you are adding. Make sure to fully test
choose-picture-v2?.]
Exercise 15.3.6 from the textbook
EXTRA CREDIT (20 points): Exercise
5.1.5
in How to Design Programs: First Edition. [Replace all
the symbols by strings in the exercise. Skip the last 3 lines
involving the master.ss teachpack.]
Submitting your Assignment
Please submit this assignment in a single Definitions Pane and
a single Interactions Pane through Moodle. Points will be deducted for
completing the assignment with multiple Definitions and/or Interactions
Panes.
Be sure to include your first and last name as a comment in the first line
of both your Definitions Pane and Interactions Pane.
The file name for the Definitions Pane needs to
be "hw9[LastName]Def.rkt" where:
[LastName] is replaced with your last name.
For example, if I were submitting this
assignment, I would name the file "hw9WittensteinDef.rkt".
Similarly, the file name for the Interactions Pane needs to be
"hw9[LastName]Int.rkt".
If these filenames are not used, points will be deducted from the
assignment grade.
| GRADING |
| Question | Point Value |
| 13.7.5 |
30 |
| Contract | 2 |
| Purpose | 2 |
| Data Analysis | 5 |
| Examples | 5 |
| Skeleton | 2 |
| Inventory | 2 |
| Function | 10 |
| Interactions Pane | 2 |
| 15.3.1 |
30 |
| Contract | 2 |
| Purpose | 2 |
| Data Analysis | 5 |
| Examples | 5 |
| Skeleton | 2 |
| Inventory | 2 |
| Function | 10 |
| Interactions Pane | 2 |
| 15.3.2 |
10 |
| 15.3.6 |
30 |
| Contract | 2 |
| Purpose | 2 |
| Data Analysis | 5 |
| Examples | 5 |
| Skeleton | 2 |
| Inventory | 2 |
| Function | 10 |
| Interactions Pane | 2 |
| HtDP 5.1.5 | +20 |
| Total | 100 + 20 |
Last Modified: 12/12/11