Final Exam: Page 1
1. (TCO 2) What is an example of a string constant? (Points : 5)
1
"oops"
12432
o
2. (TCO 2) What is the assignment operator? (Points : 5)
=
^
*
%
3. (TCO 2) The symbols used to describe the logic of a program are known as _____. (Points : 5)
desk checking
pseudocode
flowcharts
code maps
4. (TCO 2) If a variable holds the value 12345, what is its data type? (Points : 5)
Text
Integer
Floating point
String
5. (TCO 3) The logical AND operator can replace ____ in how it behaves. (Points : 5)
a sequence of selection structures
nested selection structures
nested and sequenced selection structures
division
6. (TCO 3) Which pseudocode produces the same result as the following?
if customerAge > 65 OR customerAge = 65 then
discount = 0.10
, else
discount = 0
endif (Points : 5)
if customerAge >= 65 then
discount = 0.10
else
discount = 0
endif
if customerAge > 65 then
discount = 0
else
discount = 0.10
endif
if customerAge discount = 0.10
else
discount = 0
endif
if customerAge discount = 0
else
discount = 0.10
endif
7. (TCO 3) What logic operator could be used to replace the nested selection structure in this
pseudocode?
if empMedicalIns = "Y" then
if empDentalIns = "Y" then
print empIdNumber, empLastName, empFirstName
endif
endif (Points : 5)
Dual-alternative selection
Logical AND
Logical OR
Logical NOT
(TCO 3) In order to have the most efficient program, which question should be asked first when
8.
working with an AND decision? (Points : 5)
The one that is less likely to be true
The one that is more likely to be true
The one that involves fewer comparisons
The one with the lower value
9. (TCO 3) If you are asked to write a program that prints a list of books that have fewer than 30 pages
1. (TCO 2) What is an example of a string constant? (Points : 5)
1
"oops"
12432
o
2. (TCO 2) What is the assignment operator? (Points : 5)
=
^
*
%
3. (TCO 2) The symbols used to describe the logic of a program are known as _____. (Points : 5)
desk checking
pseudocode
flowcharts
code maps
4. (TCO 2) If a variable holds the value 12345, what is its data type? (Points : 5)
Text
Integer
Floating point
String
5. (TCO 3) The logical AND operator can replace ____ in how it behaves. (Points : 5)
a sequence of selection structures
nested selection structures
nested and sequenced selection structures
division
6. (TCO 3) Which pseudocode produces the same result as the following?
if customerAge > 65 OR customerAge = 65 then
discount = 0.10
, else
discount = 0
endif (Points : 5)
if customerAge >= 65 then
discount = 0.10
else
discount = 0
endif
if customerAge > 65 then
discount = 0
else
discount = 0.10
endif
if customerAge discount = 0.10
else
discount = 0
endif
if customerAge discount = 0
else
discount = 0.10
endif
7. (TCO 3) What logic operator could be used to replace the nested selection structure in this
pseudocode?
if empMedicalIns = "Y" then
if empDentalIns = "Y" then
print empIdNumber, empLastName, empFirstName
endif
endif (Points : 5)
Dual-alternative selection
Logical AND
Logical OR
Logical NOT
(TCO 3) In order to have the most efficient program, which question should be asked first when
8.
working with an AND decision? (Points : 5)
The one that is less likely to be true
The one that is more likely to be true
The one that involves fewer comparisons
The one with the lower value
9. (TCO 3) If you are asked to write a program that prints a list of books that have fewer than 30 pages