Search Header Logo
CSP 2.1.5 Logic

CSP 2.1.5 Logic

Assessment

Presentation

Computers

9th Grade

Practice Problem

Medium

Created by

Elizabeth Mendenhall

Used 14+ 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

media

3

media

4

media

5

Multiple Choice

Are results from the AND operator mostly True or mostly False?

1

True

2

False

3

about the same for True and False

6

media

7

Multiple Choice

Question image

35. What is the result?

1

True

2

False

8

Multiple Choice

Question image

36. What is the result?

1

True

2

False

9

Multiple Choice

37. What is the output?

print ( 3 < 7 and 7 > 2 )

1

True

2

False

10

Multiple Choice

38. What is the result?

print ( 3 < 5 and -10 > 2 )

1

True

2

False

3

3 < 5 and -10 > 2

11

Multiple Choice

Question image

39. What is the result?

1

True

2

False

3

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

media

14

media

15

media

16

Multiple Choice

Are results from the OR operator mostly True or mostly False?

1

True

2

False

3

about the same for True and False

17

Multiple Choice

Question image

40. What is the result?

1

True

2

False

18

Multiple Choice

Question image

41. What is the result?

1

True

2

False

19

Multiple Choice

Question image

42. Let A and B have values that can be True or False. What is the result?

1

True when both A and B are True

2

True when A or B is True

3

Always True

4

Always False

20

Multiple Choice

43. What is the output?

print ( -2 < 4 or 7 == 2 )

1

True

2

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

Question image

44. What will the output be?

1

True

2

False

23

Multiple Choice

45. Input A can be True or False. What will be the output?

print ( 2 == 4 or A )

1

Always True

2

Always False

3

True only if A is True

4

False only if A is False

24

Logical operators: NOT

media

25

media

26

media

​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 ) )

1

True

2

False

28

Multiple Choice

47. What is the output?

print ( not ( not ( 5 == 2 ) ) )

1

True

2

False

29

Multiple Choice

Question image

48. And now for a classic AP question. Check each option, one at a time.

1

I only

2

I and II only

3

I and III only

4

I, II, and III

30

Multiple Choice

Question image

49. What could replace the missing condition in the third column?

1

a and b

2

a or b

3

not (a and b)

4

not (a or b)

31

Multiple Choice

Question image

50. What could replace the missing condition in the third column?

1

a and b

2

a or b

3

not (a and b)

4

not (a or b)

32

Multiple Choice

Question image

51. What could replace the missing condition in the third column?

1

a and b

2

a or b

3

not (a and b)

4

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