CSC 160 Fall 2006 - Homework 2
Assigned Sept 5, due TUESDAY Sept 12
Log the time you spent on this homework using the Week Two Log Sheet.
Read Section
2.1 of the online textbook along with the introductory
paragraph above it.
Read Chapter 3 and Chapter 5 of the
Simply Scheme textbook.
Do the following exercises from Simply Scheme:
2.1: Using the program functions.scm. In each line of the
following table we've left out one piece of information. Fill in the
missing details. When submitting this question, number your answers
from 1-14 and work from top to bottom.
function |
arg1 |
arg2 |
result |
word |
now |
here |
|
sentence |
now |
here |
|
first |
blackbird |
none |
first |
(blackbird) |
none |
|
3 |
4 |
7 |
every |
|
(thank you girl) |
(hank ou irl) |
member? |
e |
aardvark |
|
member? |
the |
|
#t |
keep |
vowel? |
(i will) |
|
keep |
vowel? |
|
eieio |
last |
( ) |
none |
|
|
last |
(honey pie) |
(y e) |
|
|
taxman |
aa |
2.4: One of the functions you can use is called item. Experiment
with it, and then describe fully its domain and range, and what it does.
(Make sure to try lots of cases. Hint: Think about its name.)
3.1: Translate the arithmetic expressions (3 + 4) x 5 and 3 + (4 x
5) into Scheme expressions. [You do not need to do plumbing diagrams.]
3.4: Five little people are hired in evaluating the following
expression:
(+ (* 3 (- 4 7))
(- 8 (- 3 5)))
Give each little person a name and list her specialty, the argument
values she receives, her return value, and the name of the little person
to whom she tells her result.
Turn this assignment in by email to
Wittenstein@adelphi.edu. Be sure to include your first and last
name!
GRADING |
Exercise |
Point Value |
2.1 |
26 |
2.1.10 |
2 (x-cr) |
2.4 |
19 |
3.1 |
20 |
3.4 |
25 |
Log |
10 |
Last Modified: 9/11/06