ch3 Flashcards
control structure
is a logical design that controls the order in which a set of statements execute
the if statement executes when
boolean is true
when a program compares characters it is actually comparing …
ASCII CODES
the if statement is a BLANK
the if else statement is a BLANK
single alternative decision
dual alternative decision
the and and or operators will stop evaluating if the expression on the left is false this called
short circuit evaluation
and or and not are BLANK operators
logical
compound boolean expression is true only when both subexpression are true
BLANK OPERATOR
and
compound boolean is true is either subexpression are true is
or
boolean variables are commonly used as BLANK and if it is set to BLANK it indicates the condition does not exist
flags
False
A BLANK is a boolean variable that signals when some condition exists in the program
flag
what operator is best used to determine whether a number is inside a range?
or operator
name 3 control structures
and can you use more than one in a program?
sequence
decision or selection which include single and dual alternative decision structures
yes more than one type of structure can be used
what are sone relational operators
greater than /equal
less than/equal
equal to
not equal to
short circuit evaluation
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
what does a nest if else statement look like?
if else if else if else
or using elif
if elif elif elif else