CS 140 Lecture Notes - Lecture 9: Boolean Expression, Operand, Logical Disjunction

35 views2 pages

Document Summary

2 or more if else conditions that connect with each other. Example: if cold outside if snowing wear jacket else wear shorts. Binary logical operators used to combine boolean expressions. Unary logical operator : (!) used to reverse the truth of a boolean expression. Logical and or logical or operations perform short circuit evaluation of expressions. Logical and will evaluate to false as soon as it sees that one of its operands is a false expression. Logical or will evaluate to true as soon as it sees that one of its operands is a true expression. The ! operator has a higher order of precedence than && and ii operators. Use parenthesis as the main way of determining the order of precedence. Use to write a simple statement that like an if-else statement. Y =boolean, if boolean is true, = value 1; if false, =value 2. If the boolean expression is true, the value of the conditional operator is.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related textbook solutions

Related Documents