Lab Module A -- Basic use of the Scheme language, of the DrScheme implementation.
CISC 280 Program Development Techniques
Goals:
- Be able to use DrScheme on the composers. In particular,
configure your environment on the composers to use DrScheme easily.
Optionally, download DrScheme to your PC.
-
Be able to use Scheme as a sort of glorified calculator, entering compound
arithmetic expressions for evaluation.
-
Be able to define and use simple proceedures, including
- procedures which call other proceedures you have defined, and
- procedures which use the "if" and "cond" constructs.
Reading: SICP (Structure and Interpretation of Computer Programs), Section 1.1.
Scan DrScheme online help to understand the two part DrScheme window and
the "language levels" setup.
Homework exercises (Due at start of lab 12 Feb 01):
-
SICP Exercise 1.1. Type the expressions into DrScheme. See, print, submit the results.
-
SICP Exercise 1.3. In your solution first define and then use the procedures
square and sum-of-squares given on page 13.
Use the if construct and use no cond's.
-
SICP Exercise 1.3 again. This time use exactly one cond construct and no if's.
-
Flourish credit: Write a procedure (second-of-5 a b c d e) which returns the second largest
of five numbers. Remark, you may want to use the built in proceedure max which returns the
largest of any number of arguments.
Topping off exercise (done in lab):
The problem will be similar to homework #2 or #3. You will be asked to define
a procedure which uses
cond or if and which calls other procedure(s) you define.