Give four examples of OR from daily life illustrating the four cases of true or false, false or true, true or true, and false or false. (Do not give an example of an if-then statement from daily life, and its contrapositive. Do not explain why you agree or disagree that the two if-then statements say the same thing.)
Ordering food from Pizza Hut: Medium Pepperoni Pizza and Chicken Alfredo
Pizza (TRUE) OR Alfredo (FALSE): Get the Pizza, not the Alfredo
Pizza (FALSE) OR Alfredo (TRUE): Get the Alfredo, not the Pizza
Pizza (TRUE) OR Pasta (TRUE): Get both or either one of them
Pizza (FALSE) OR Pasta (FALSE): Starve
Putting Money in Banking Accounts
Checking (TRUE) OR Savings (FALSE): Put the money in your Checking account, not the Savings account
Checking (FALSE) OR Savings (TRUE): Put the money in your Savings account, not the Checking account
Checking (TRUE) OR Savings (TRUE): Put in one or split and put in both accounts
Checking (FALSE) OR Savings (FALSE): You don't have any money to put in either of these accounts, sorry
Friend's Night: Movies or Video Games
Movies (TRUE) OR Video Games (FALSE): Just watch movies, don't play games
Movies (FALSE) OR Video Games (TRUE): Just play games, don't watch movies
Movies (TRUE) OR Video Games (TRUE): Watch movies and/or play games
Movies (FALSE) OR Video Games (FALSE): Cancel your plans with your friends
What am I getting from Best Buy during Black Friday?
49 Inch Dell Curved Monitor - Adjustable $999 $1499 (TRUE) OR Electric Kickstand Scooter $350 $599 (FALSE): Get the monitor instead of the scooter
49 Inch Dell Curved Monitor - Adjustable $999 $1499 (FALSE) OR Electric Kickstand Scooter $350 $599 (FALSE): Get the scooter instead of the monitor
49 Inch Dell Curved Monitor - Adjustable $999 $1499 (TRUE) OR Electric Kickstand Scooter $350 $599 (TRUE): Get both, why not? I have enough money
49 Inch Dell Curved Monitor - Adjustable $999 $1499 (FALSE) OR Electric Kickstand Scooter $350 $599 (FALSE): Too poor. Unfortunate
(2) Using JavaScript, write code that will print 5 lines: one for each row of the truth table for OR, plus a line containing the column labels.
(3) Using JavaScript, write code that will print 5 lines: one for each row of the truth table for AND, plus a line containing the column labels.
(4) What is the integer value of an 8-bit byte containing the following bit sequences?
00000001
00000010
00000011
3
00000100
4
00001000
8
00001111
15
(5) Answer these bitwise operator questions
What is 7^7 in JavaScript?
The XOR Operator sets each bit to 1 if one of two bits is 1
What is 7 & 7? Explain.
The AND Operator sets both bits to 1 if both bits are 1
What is 7 | 7? Explain.
The OR Operator sets both bits to 1 if either bit is 1
(6)
What is the minimum score on a HW assigment in this course?
50 points
(7)Pick option a, b or c.
a. Build more interesting buttons! Add them to your growing collection or, if you prefer, make this a new program without earlier buttons. The buttons should demo the the bitwise logic operators in the w3schools lesson (https://www.w3schools.com/js/js_bitwise.asp), explaining each operator, as well as demo questions (2), (3) & (4) above.