[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Assignments] [Labs]
Back to Control. On to Procedures and Parameter Passing.
Held Wednesday, April 28
Summary
Contents
Handouts
Notes
succ
and pred is to start with zero.
begin/end)
or key symbols
({/}).
if G1 -> S1 | G2 -> S2 | G3 -> S3 ... | Gn -> Sn fi
G's are guards (boolean expressions that
serve as tests).
S's are statements (stuff to execute).
Object max(Comparator compare, Object x, Object y)
{
if (compare.lessThan(x,y))
return y;
else
return x;
} // max
y as the maximum, even
when they're equal. In most cases, we don't really care which we use.
Object max(Comparator compare, Object x, Object y)
{
if compare.lessThan(x,y) -> return y;
| compare.lessThan(y,x) -> return x;
fi
} // max
if mouseIsDown -> handleMouse() | keyIsDown -> handleKey() fi
History
Back to Control. On to Procedures and Parameter Passing.
[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Assignments] [Labs]
Disclaimer Often, these pages were created ``on the fly'' with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS302/99S/Outlines/outline.35.html
Source text last modified Sun May 2 15:24:13 1999.
This page generated on Sun May 2 16:12:58 1999 by SiteWeaver. Validate this page's HTML.
Contact our webmaster at rebelsky@math.grin.edu