CPSC 110 Chapter Notes - Chapter 2: Webex, Data Definition Language
ferrari12 and 39375 others unlocked
23
CPSC 110 Full Course Notes
Verified Note
23 documents
Document Summary
Webex notes - module 2 - how to design data. Allows us to program conditional statements with more than 2 cases that are on the same level. [ question answer] )) (cond [(> (image-height img) (image-width img) ) tall ] [(= (image-height img) (image-width img) ) square ] Nb: ( ) could be used instead of [ ] racket treats them the same. Nb: the else is used as the last option which reads if condition 1 or condition 2 is not met then do this. In this case, if it is not tall, or square then it is wide. Evaluating a cond expression: (cond [ (> 1 2) bigger ] Evaluate the first conditional statement (cond [ false bigger ] Since the first conditional statement is false, it is deleted and we move to the next conditional statement (cond [ (= 1 2) equal ] Evaluate the 2nd conditional statement (cond [ false equal ]