Held Friday, February 2, 2001
Today we begin to learn how to tell Scheme to make decisions. The procedures used to make decisions are called conditionals.
http://www.cs.grinnell.edu/~schriebe/hub.html(Makinen, Martin, and Schrieber): Reviews of introductory computer science courses (and how easy it is to find info on the courses at various institutions).
http://www.cs.grinnell.edu/~walkerxh/hmwk1.html(Eilert, Heinz, Walker): Reflections on starting CS.
http://www.cs.grinnell.edu/~nusswarr/hw1/(DeVilder, Gamboa, and Nuss-Warren): Basic programming strategies.
http://www.cs.grinnell.edu/~waymouth/website/index.html(Kase and Waymouth): Scheme commands.
http://www.math.grin.edu/~farrow/index2.html(Farrow and Hodgman): An introduction to Scheme.
http://www.math.grinnell.edu/~hernanda/index.html(Hernández and Ipatova): Exploring Scheme and CS.
if. For example,
if the grade is at least 94, then give the student an A, otherwise, if the grade is between 90 and 93, ...
(if condition success-expression failure-expression)
ifdoes not behave according to Marie's evaluation pattern (in which all the arguments to a procedure are computed before the procedure is applied).
(if (>= grade 94) 'A 'F)
(if (>= grade 94) 'A (if (<= 90 grade 93) 'Aminus (if (<= 87 grade 90) ...)))
cond, which more closely resembles a table.
condexpression looks like
(cond ((condition1) exp1) ((condition2) exp2) ((condition3) exp3) ... (else default-exp))
(cond ((>= grade 94) 'A) ((<= 90 grade 93) 'Aminus) ...)
Friday, 12 January 2001
Thursday, 1 February 2001
Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.
This page was generated by Siteweaver on Wed May 5 12:14:49 2004.
This page may be found at
You may validate this page's HTML.
The source was last modified Thu Feb 1 20:48:24 2001.