CMPT 120 Lecture Notes - Lecture 8: Operand, Boolean Expression, Logical Connective
![CMPT 120 Full Course Notes](https://new-docs-thumbs.oneclass.com/doc_thumbnails/list_view/2242525-class-notes-ca-sfu-cmpt-120-lecture27.jpg)
29
CMPT 120 Full Course Notes
Verified Note
29 documents
Document Summary
Lecture 8 part 3: logical operators, variables, statements. Logical operator: and and: the and is a binary logical operator that connects two boolean expressions into one compound expression. The result of and compound binary expression is true when all the sub expressions are true. Ie. the result of a compound boolean expression marks >=90 and marks < 95 will be true, when the results of: Marks >=90 boolean expression is true, and. Marks < 95 boolean expression is true. Logical operator: or or: the or is a binary logical operator that connects two boolean expressions into one compound expression. The result of or compound binary expression is true when either of the sub expressions is true. For example, the result of a compound boolean expression gpa >= 2. 5 or height >= 7 (closing hours) will be true, when either the result of: Gpa > 2. 5 boolean expression is true, or. Height > =7 boolean expression is true.