ch3 Flashcards

1
Q

control structure

A

is a logical design that controls the order in which a set of statements execute

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

the if statement executes when

A

boolean is true

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

when a program compares characters it is actually comparing …

A

ASCII CODES

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

the if statement is a BLANK

the if else statement is a BLANK

A

single alternative decision

dual alternative decision

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

the and and or operators will stop evaluating if the expression on the left is false this called

A

short circuit evaluation

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

and or and not are BLANK operators

A

logical

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

compound boolean expression is true only when both subexpression are true

BLANK OPERATOR

A

and

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

compound boolean is true is either subexpression are true is

A

or

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

boolean variables are commonly used as BLANK and if it is set to BLANK it indicates the condition does not exist

A

flags

False

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

A BLANK is a boolean variable that signals when some condition exists in the program

A

flag

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

what operator is best used to determine whether a number is inside a range?

A

or operator

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

name 3 control structures

and can you use more than one in a program?

A

sequence
decision or selection which include single and dual alternative decision structures

yes more than one type of structure can be used

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

what are sone relational operators

A

greater than /equal
less than/equal
equal to
not equal to

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

short circuit evaluation

A

affects and and or operators

for and operators
if the expression on the left side of the operator is false the right side will not be checked because the compound expression will be false if only one of the subexpressions is false

for or operators
if the expression on the left side of the operator is true the right side will not be checked because the compound expression will be true if only one of the subexpressions is true

this saves cpu time

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

what does a nest if else statement look like?

A
if
else
  if
  else
    if
    else

or using elif

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

describe how and operator works

A

takes two Boolean expressions as operands and creates a compound expression that is true only when both subexpressions are true

17
Q

describe how the or operator works

A

takes two boolean expression and creates compound expression that is true when either subexpressions are true