CSC 160 Fall 2006 - Homework 3
Assigned Sept 26, due TUESDAY Oct 3
Log the time you spent on this homework by creating your
own log sheet.
Read the article
on Pair Programming.
Read Sections
2.2 and 2.3 of the online textbook.
Read Chapter 4 of the
Simply Scheme textbook.
The Assignment
The assignment may be done alone or in pairs using the ideas in the Pair
Programming article. (You cannot pair up with the
same person more than once during the semester.)
Questions 1, 3, and 4 may be done in either the Simply Scheme
language mode or the Beginning Student language mode.
Question 2 will only work in the Simply Scheme language
mode.
Whenever defining a Scheme function, you must include an example of
how the
function is called, along with what its answer "should be". (For
an explanation of this requirement, click
here.)
Please 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.)
1. Simply Scheme exercise 4.5b: Define a Scheme function to convert a
temperature from Fahrenheit to Celsius. [Hint: The formula is: C
=
(5/9)(F
- 32)].
2. Simply Scheme exercise 4.6: Define a Scheme function fourth
that
computes the fourth power of its argument. [Please write it just one
way, the way of your choice. You can use expt, sqr, and/or * in the
function body.]
3. Additional Question: Define a Scheme function average3 that
will
return the average of 3 exam scores.
4. Additional Question: On page 51 of Simply Scheme, the
sum-of-squares function is written. Please write a similar function
called sum-of-cubes, which does what it says, finds the sum of the
cubes of two numbers. [Note: Make sure you copy (or re-type) the
cube function from the 9/26 lecture slides into
the Definitions Window before writing sum-of-cubes.]
Submitting your Assignment
Please submit your Definitions 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 "hw3[section][LastName]Def.scm" where:
[section] is replaced by -01 for the 3:05 class and -02 for the 4:30 class
[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
"hw3-01WittensteinDef.scm".
Similarly, the file name for the Log Sheet needs to be
"log3[section][LastName].doc".
GRADING |
Question |
Point Value |
First |
30 |
Second |
30 |
Third |
30 |
Fourth |
10 (X-CR) |
Log |
10 |
Last Modified: 10/2/06