Fundamentals of Computer Science 1 (CS151 2003S)
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Project]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Scheme Reference]
[Scheme Report]
[CS151 2003S Gum]
[CS151 2002F]
[CS151 History]
[SamR]
Back to Procedure Definitions. On to Conditionals Lab.
Held: Tuesday, 4 February 2003
Summary: Today we begin to learn how to tell Scheme to make decisions. The procedures used to make decisions are called conditionals. Today's class will be a large group design effort rather than an individual or small group design effort.
Related Pages:
Assignments
Notes:
Overview:
ifif. 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)
if does not behave according to the standard
pattern, in which all the arguments
to a procedure are computed before the procedure is applied).
(if (<= 90 grade) 'A 'F)
(if (<= 90 garde)
'A
(if (<= 80 grade 89)
'B
(if (<= 70 grade 79)
...)))
(if (<= grade 90)
'A
(if (<= 80 grade)
'B
(if (<= 70 grade)
...)))
cond, which more closely resembles a table.
cond expression looks like
(cond ((condition1) exp1) ((condition2) exp2) ((condition3) exp3) ... (else default-exp))
(cond ((<= 90 grade) 'A) ((<= 80 grade) 'B) ...)
if nor cond?
#t) or false
(#f).
< (strictly less than),
<= (less than or equal to),
= (equal to),
>= (greater than or equal to),
and
> (strictly greater than).
=,
eq?,
eqv?, and
equal?.
and,
or, and not.
Thursday, 16 January 2003 [Samuel A. Rebelsky]
Tuesday, 4 February 2003 [Samuel A. Rebelsky]
Back to Procedure Definitions. On to Conditionals Lab.
[Skip to Body]
Primary:
[Front Door]
[Current]
[Glance]
-
[EC]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Lab Writeups]
[Outlines]
[Project]
[Readings]
[Reference]
ECA:
[About]
[Grades]
[Quizzes]
[Submit Work]
[Change Password]
[Reset Password]
Misc:
[Scheme Reference]
[Scheme Report]
[CS151 2003S Gum]
[CS151 2002F]
[CS151 History]
[SamR]
Disclaimer:
I usually create these pages on the fly
, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 6 09:29:40 2003.
The source to the document was last modified on Tue Feb 4 11:04:48 2003.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2003S/Outlines/outline.10.html.
You may wish to
validate this document's HTML
;
;
Check with Bobby