chapter 3 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

logical value/ Boolean value

A

can either be true (1) or false (0)

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

logical variable

A

can only hold logical values

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

logical operator

A

compares 2 logical variables to reach logical decision that results in logical value is true or false

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

And operator

A

&
returns true if logical variable a and b are BOTH TRUE

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

Or operator

A


returns true if a or b is true (ANY TRUE)

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

Not operator

A

~
returns true if A is false and B is true and vice versa (OPPOSITES)

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

Xor operator

A

returns true if a or b is true but NOT BOTH
exclusive

xor(a, b)

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

equality operator

A

whether two numbers are equal

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

a = = b

A

a is equal to b

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

a ~ = b

A

a is not equal to b

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

relational operator

A

compares numbers and evaluates to true or false

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

a<b

A

a is less than b

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

a>b

A

a is greater than b

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

a <= b

A

a is less than or equal to b

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

a => b

A

a is more than or equal to b

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

== VS =

A

== equal to
= assign value

17
Q

range

A

10 < x AND x<15
detects if x is within the range

18
Q

logical operators evaluate…

A

L to R

19
Q

short circuit evaluation

A

skips evaluating later operands if it can already be determined as true or false

20
Q

&&

A

short circuit and

21
Q

||

|

A

short circuit or

22
Q

precedence rule

A

basically PEMDAS then
1) ==
2) relational operators (< <= > >=)
3) &
4) |
5) &&
6) ||

23
Q

binary operators

A

relational and logical (except NOT)
evaluates either true or false

24
Q

utilize what to ensure code is read how you want

A

parenthesis

25
Q
A