(Last Mod: 27 November 2010 21:38:40 )
Name: CODE: Section: Date:
NO CALCULATORS MAY BY USED ON THIS QUIZ
Which of the following are all pairs of complementary operators?
(||
,
&&
), (+
, -
),
(/
, /%
).
(==
,
!=
), (>
, <
),
(=
, <=
).
(<=
,
>
), (!=
, ==
),
(>
, <=
).
(!
,
~
), (|
, ||
),
(&
, &&
).
Which of the following statements is NOT true?
Logical and relational operators always return a value of 1 if the expression is True
Negative values cannot be used or interpreted as logical values.
A value is considered a logical False only if it evaluates exactly to zero.
Functions that return logical results may return values other than a 0 or a 1.
What are the three building blocks of a structured program?
for
() loops, while
() loops, and
do
/while
() loops
Statements, functions, and files.
Loads, stores, and branches
Sequences, selections, and repetitions.
What is the category that ASCII codes fall into if they are printing characters but are not alphanumeric?
punctuation characters.
control characters.
white space.
escape sequences.
Why is it considered a bad idea to use floating point data as operands to logical or equality/inequality operators?
Because these operators are only defined for integer operands.
Because floating point values are almost guaranteed to evaluate as False and/or not equal.
Because any value less than some pre-defined amount will be considered False.
Because zero cannot be exactly represented by a floating point value.