CSC 160 Fall 2007 - Homework 9
Assigned Nov 30, due MONDAY Dec 10
Log the time you spend on this assignment using a log sheet with
all the same columns as the one attached to the PSP Chapter 3
handout. For your convenience, I have attached a blank Microsoft
Excel copy of it here.
Read Chapter 13 of Dr. Bloch's textbook.
Do the following exercises in DrScheme on your own or in pairs (using the ideas in
the Pair
Programming article):
Exercise 11.4.1 from Dr. Bloch's textbook: Develop a function
choose-picture
that takes in one of the strings "basketball", "baseball", or "calendar"
and returns a picture of it. For any other string, return a string
stating "Out of Stock". Be sure to show ALL Design Recipe
steps (including Data Analysis) and 4 well-chosen examples. Use
the following pictures in your function definition:
.
Exercise 4.4.2a from How to Design
Programs: Develop the function tax, which consumes
the gross pay
and produces the amount of tax owed. For a gross pay of $240 or less,
the tax is 0%; for over $240 and $480 or less, the tax rate is 15%;
and for any pay over $480, the tax rate is 28%. Be sure to show ALL Design
Recipe steps (including Data Analysis) and at least 5
well-chosen examples.
Submitting your Assignment
Please submit your Definitions Pane, Interactions Pane, and Log Sheet, using the Digital Dropbox in the Tools menu on
Blackboard. Be sure to include your first and
last name(s) in the Name Box on Blackboard, and click Send File (not Add
File)!
The file name for the Definitions Pane needs to
be "hw9[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(s).
For example, if I were submitting this
assignment and I were in the 10am class, I would name the file
"hw9-02WittensteinDef.scm".
Similarly, the file name for the Interactions Pane needs to be
"hw9[section][LastName]Int.scm", and the file name for the Log Sheet needs
to be "hw9[section][LastName]".
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 |
| 11.4.1 |
45 |
| Contract |
3 |
| Purpose |
3 |
| Data Analysis |
10 |
| Examples |
8 |
| Skeleton |
3 |
| Function |
15 |
| Interactions Pane |
3 |
| HtDP 4.4.2a |
45 |
| Contract |
3 |
| Purpose |
3 |
| Data Analysis |
8 |
| Examples |
10 |
| Skeleton |
3 |
| Function |
15 |
| Interactions Pane |
3 |
| PSP Log |
5 |
| Filenames |
5 |
| Total |
100 |
Last Modified: 12/4/07