Quiz 1
Quiz 1
Quiz 1
a) <>
b) ==
c) >=
d) ≥
e) >
Result = x + y / 2 ^ 2
a) Result
b) x, y, 2
c) =
d) +, /, ^
e) 2
5) Which operator is used to compare the value of two data items?
a) logical
b) relational
c) physical
d) arithmetic
e) mathematical
6) When we want to compare the value (variable called GPA) whether it is between 3.0 and 5.0,
which of the following logical expression can be used?
a) if (GPA > 3.0 and GPA < 5.0) then
b) if NOT (GPA > 3.0 and GPA < 5.0) then
c) if (GPA >= 3.0 and GPA < 5.0) then
d) if (GPA > 3.0 and GPA <= 5.0) then
e) if (GPA > 3.0 or GPA < 5.0) then
8) If x contains the value 5 before the following instruction is executed, what is the value of
x after the instruction: x = x * 6; is executed?
a) 5
b) 30
c) the value is unknown
d) the statement is illegal
e) 36
10) Which of the following is the correct rules for naming a variable ?
a) Name a variable according to what it represents.
b) Do not use spaces.
c) Start a variable name with a letter.
d) Do not use a dash or any other symbol that is used as a mathematical operator
e) All the above.