Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie...
-
Upload
kerry-berry -
Category
Documents
-
view
215 -
download
0
Transcript of Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie...
![Page 1: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/1.jpg)
Boolean ValuesThe true story
;=P
Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE
![Page 2: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/2.jpg)
![Page 3: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/3.jpg)
Expressions
![Page 4: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/4.jpg)
Relational Operators
![Page 5: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/5.jpg)
Relational Operators
![Page 6: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/6.jpg)
Relational Operators
![Page 7: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/7.jpg)
Logical Operators
![Page 8: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/8.jpg)
Truth Tables
![Page 9: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/9.jpg)
Logical Operators
![Page 10: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/10.jpg)
Negation of Logical Operator
![Page 11: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/11.jpg)
Logical Operators
![Page 12: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/12.jpg)
Precedence
![Page 13: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/13.jpg)
Logical Operators Exercise 1 Elbow Pairs
![Page 14: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/14.jpg)
Negation of StatementsO Negate the statements below:
O isBroken==true____________________
O phoneAge >=3_____________________
isBroken == false
phoneAge < 3
![Page 15: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/15.jpg)
Logical Operators Exercise 2
![Page 16: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/16.jpg)
Negation of statementsO Negate the statements belowO x==y__________________O y==z__________________
x != y
y != z
![Page 17: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/17.jpg)
Boolean Algebra
![Page 18: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/18.jpg)
de Morgan’s Law Version 1
![Page 19: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/19.jpg)
de Morgan’s Law Version 2
![Page 20: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/20.jpg)
de Morgan’s Law
![Page 21: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/21.jpg)
de Morgan’s Law
![Page 22: Boolean Values The true story ;=P Thanks to Margaret Reid-Miller for her original ideas at Carnegie Mellon’s CSE.](https://reader035.fdocuments.us/reader035/viewer/2022081516/5697bfda1a28abf838cafec8/html5/thumbnails/22.jpg)
What to do?O Statement a= your Practice Its are completeO Statement b = you have an A if (!(a) || !b) { System.out.println(“Let’s get busy NOW”); }else if !(a ||b) { System.out.println(“You Have Work To Do, so get busy.”);} else
System.out.println(“Program the game Pig”);