CMPT 120 Lecture Notes - Lecture 8: Operand, Boolean Expression, Logical Connective

31 views2 pages
meghan78 and 39786 others unlocked
CMPT 120 Full Course Notes
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.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents