
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
24 questions
Identifying Functions
Presentation
•
9th Grade
20 questions
INFORMATIKA 9
Presentation
•
9th Grade
23 questions
Occupations related to digital media careers
Presentation
•
9th Grade
24 questions
Google Applications
Presentation
•
8th - 9th Grade
25 questions
Electron Configuration, Orbital Notation, & Dot diagrams
Presentation
•
9th - 12th Grade
25 questions
Graphing linear functions
Presentation
•
9th Grade
26 questions
Ionic Bonds
Presentation
•
9th Grade
26 questions
DNA Basics
Presentation
•
9th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade