
CSP 2.1.5 Logic
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Medium
Elizabeth Mendenhall
Used 15+ times
FREE Resource
13 Slides • 19 Questions
1
2.1.5 Logic
This activity was adapted from a New Jersey Center for Teaching and Learning resource.
2
Logical operators
3
4
5
Multiple Choice
Are results from the AND operator mostly True or mostly False?
True
False
about the same for True and False
6
7
Multiple Choice
35. What is the result?
True
False
8
Multiple Choice
36. What is the result?
True
False
9
Multiple Choice
37. What is the output?
print ( 3 < 7 and 7 > 2 )
True
False
10
Multiple Choice
38. What is the result?
print ( 3 < 5 and -10 > 2 )
True
False
3 < 5 and -10 > 2
11
Multiple Choice
39. What is the result?
True
False
2, 4
12
Short circuits
Not only is the previous question False, but it is also a short circuit. Since the first condition is false, the computer won't even look at the second condition. It's unnecessary.
You don't have to know the term "short circuit" for the AP exam, but it's a helpful concept. 😎
13
14
15
16
Multiple Choice
Are results from the OR operator mostly True or mostly False?
True
False
about the same for True and False
17
Multiple Choice
40. What is the result?
True
False
18
Multiple Choice
41. What is the result?
True
False
19
Multiple Choice
42. Let A and B have values that can be True or False. What is the result?
True when both A and B are True
True when A or B is True
Always True
Always False
20
Multiple Choice
43. What is the output?
print ( -2 < 4 or 7 == 2 )
True
False
21
Another short circuit
Consider the previous question: print ( -2 < 4 or 7 == 2 )
This is also an example of a short circuit. Since the first condition is True, the computer doesn't even check the second condition.
22
Multiple Choice
44. What will the output be?
True
False
23
Multiple Choice
45. Input A can be True or False. What will be the output?
print ( 2 == 4 or A )
Always True
Always False
True only if A is True
False only if A is False
24
Logical operators: NOT
25
26
NAND and NOR - just FYI
In diagrams, NOT AND is often shortened to NAND.
NOT OR is shortened to NOR.
Each condition, or "gate", has it own symbol.
27
Multiple Choice
46. What is the output?
print ( not ( 5 == 2 ) )
True
False
28
Multiple Choice
47. What is the output?
print ( not ( not ( 5 == 2 ) ) )
True
False
29
Multiple Choice
48. And now for a classic AP question. Check each option, one at a time.
I only
I and II only
I and III only
I, II, and III
30
Multiple Choice
49. What could replace the missing condition in the third column?
a and b
a or b
not (a and b)
not (a or b)
31
Multiple Choice
50. What could replace the missing condition in the third column?
a and b
a or b
not (a and b)
not (a or b)
32
Multiple Choice
51. What could replace the missing condition in the third column?
a and b
a or b
not (a and b)
not (a or b)
2.1.5 Logic
This activity was adapted from a New Jersey Center for Teaching and Learning resource.
Show answer
Auto Play
Slide 1 / 32
SLIDE
Similar Resources on Wayground
27 questions
Taxes - Basics
Presentation
•
9th Grade
23 questions
Operating Systems
Presentation
•
9th Grade
28 questions
Introduction Database and Database Management System
Presentation
•
8th - 9th Grade
22 questions
Pemrograman
Presentation
•
9th Grade
25 questions
Biology EOC Review 3- DNA & Mutations
Presentation
•
9th Grade
26 questions
SouthEast Asia
Presentation
•
9th Grade
26 questions
Mean, Median, Mode, & Range
Presentation
•
9th Grade
26 questions
17.4 Evidence of Evolution
Presentation
•
9th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade