CSE 5J Lecture Notes - Lecture 5: Boolean Expression
Document Summary
20 % 7 = 6 (remainder of division ) += compound = and +x += 3; (x = x+3 x /= 10; Java rule that () binds indefinitely (order of op) colormode(#, #, #, #); = switches it from rgb to hue, saturation, and brightness chapter 5. An expression that evaluates to true or false (has bolean type) Logical operators are ops that take booleans as input and produce a boolean as output. True if p and q are both true, false otherwise. True if p or q is true, false otherwise. True if p is false, not p ((x<5) && (y>2)) It"s not true that x is less than 5 and y is greater than 2 . Boolean canfire = (check if previous statement is right) (output is either true or. *statement is usually a block (boleanexpr (if true) statement . // i is declared and initialized in this block rect(100 + i, 200, 100, 100);