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 inloopend loopSophia ^_^Oh yeah... Take Your Kids to Work Day tomorrow, have fun guys!!!!
No comments:
Post a Comment