Tuesday, November 2, 2010

Loop

First of all, happy brithday to George Boole, he was the inventor of the Boolean Algebra. *clap* *clap*
Today in class, we learned some new keywords, which are case and loop.

An example of the use of case:

case destination of
   label "YHM", "YOW", "YYZ":
      % Ontario destinations
      gate := "gate 15."
   label "YQB", "YUL":
      % Quebec destinations
      gate := "gate 37."
   label "YLW" "YQQ", "YVR", "YYJ":
      % B.C. destinations
      gate := "gate 6."
   label:
      % unknown destination
      gate := "information desk."
end case

put "Please proceed to ", gate

It is easier than the IF statement when there are a lot of varibles.

The propose for LOOP is basiclly to repeat the statement in

loop

end loop

Sophia ^_^

Oh yeah... Take Your Kids to Work Day tomorrow, have fun guys!!!!

No comments:

Post a Comment