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

38 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+
$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 textbook solutions

Related Documents