Unit 3: Boolean Expressions and If Statements Flashcards

1
Q

If just two conditions on an if statement, it will be ___.
If more, it will be ___.

A

if, else
if, else if, else

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

way to represent and in boolean expressions:
way to represent or in boolean expressions:
way to represent not equal in boolean expressions:

A

&&
||
!, !=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

if there’s an and expression, and the first case is false, ___.
if there’s an or expression, and the first case is true, ___.

A

then the second case won’t be looked at and it’s false.
then the second case won’t be looked at and it’s true

(even if the second thing would cause an error it will not be looked at and compile)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

!(a && b) is also:
!(a II b) is also:

A

!a II !b
!a && !b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

!(c < d) is equivalent to:
!(c > d) is equivalent to:
!(c <= d) is equivalent to:
!(c >= d) is equivalent to:

A

c >= d
c <= d
c > d
c < d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

!(c == d) is equivalent to:
!(c != d) is equivalent to:

A

c != d
c == d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly