CSC 160 Fall 2006 - Homework 4
Assigned Oct 5, due SUNDAY Oct 15
Log the time you spent on this homework by creating your
own log sheet.
Read the PSP handout (given out in class on Th 10/5).
Complete the "Assignment" in the handout and submit in the same
Microsoft Word file as your log.
Read Sections
2.4 and 2.5 of the online textbook.
Programming Assignment
The assignment may be done alone or in pairs using the ideas in the Pair
Programming article. (Remember that you cannot pair up with the
same person more than once during the semester.)
Starting with HW4, whenever defining a Scheme function, you must
show all six steps of the Design Recipe introduced in class on Thursday 10/5.
Please complete this assignment in the Simply Scheme Language Mode
and answer any 3 of the following 4 questions. (Each question
is worth 30 points. If you choose to answer all four, you can get
up to 10 points extra credit on this assignment.)
Exercises based on the October 3 and October 5
classes
Simply Scheme Exercise 5.17: Develop a Scheme function
knight that takes a person's name as its argument and
returns the name with 'Sir in front of it.
Simply Scheme Exercise 5.15: Develop a Scheme function
first-two
that takes a word (containing two or more letters) as its argument,
returning a two-letter word containing the first two letters of the
argument.
Exercises based on the October 10 class:
Additional Exercise: Develop a Scheme function named
mirror-vert,
which is similar to the mirror-horiz function written in class on
October 10, except that the
image is reflected vertically (instead of horizontally). Your original
image should be on top, and the reflected version directly underneath
it.
Additional Exercise: Develop a Scheme function named
checkerboard
which takes
in two colors and returns a 2x2 checkerboard arrangement of them (i.e. the
colors in the two rows are in the opposite order). For full credit, you
must "use" the counterchange function we wrote in class on October 10. (Hint: Create solid rectangles with each
of the colors.)
Submitting your Assignment
Please submit your Definitions Window, your Interactions Window, and
your Log Sheet, using the Digital Dropbox in the Tools menu on
Blackboard. Be sure to include your first and
last name!
The file name for the Definitions Window needs to
be "hw4[section][LastName]Def.scm" where:
[section] is replaced by -01 for the 3:05 class and -02 for the 4:30
class, and
[LastName] is replaced with your last name.
For example, if I were submitting this
assignment and I were in the 3:05 class, I would name the file
"hw4-01WittensteinDef.scm".
Similarly, the file name for the Interactions Window must to be
"hw4[section][LastName]Int.scm"
And, the file name for the Log Sheet
must be "log4[section][LastName].doc".
If you use an incorrect file name, up to 5 points may be
deducted.
You must submit only one Definitions Window and only one
Interactions
Window which includes the entire assignment. Otherwise, up to 5 points
may be deducted.
The Interactions Window MUST include testing for each function.
Grading |
Purpose |
Contract |
Examples |
Skeleton |
Definition |
Testing |
Question 1 |
/3 |
/3 |
/3 |
/3 |
/15 |
/3 |
Question 2 |
/3 |
/3 |
/3 |
/3 |
/15 |
/3 |
Question 3 |
/3 |
/3 |
/3 |
/3 |
/15 |
/3 |
Extra Credit |
/1 |
/1 |
/1 |
/1 |
/5 |
/1 |
Log/PSP |
/10 |
Last Modified: 10/5/06