COMP 230 WEEK 4 QUIZ SOLUTIONS
1. Question : (TCO 4) A variable that determines if a loop will continue is known as a
____.
Student Answer:
loop marker
counter
looping variable
loop-control variable
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 0 of 2
Comments:
1809981007 MultipleChoice 3 False
0 1809981007 MultipleChoice 3
2. Question : (TCO 4) What is the name for the statements that are repeated during
loop execution?
Student Answer:
Loop body or code block
Decision statements
Loop group
Loop variables
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 0 of 2
Comments:
1809981008 MultipleChoice 4 False
0 1809981008 MultipleChoice 4
3. Question : (TCO 4) Which piece of pseudocode represents incrementing the loop-
control variable called rep?
Student Answer:
rep = 1
while (rep <= 10)
, rep = rep + 1
print "warning"
Instructor The counter variable is incremented.
Explanation:
Points Received: 2 of 2
Comments:
1809981009 MultipleChoice 7 True
0 1809981009 MultipleChoice 7
4. Question : (TCO 4) When a value is incremented by 1, ____.
Student Answer:
1 is added to the value
the value is multiplied by 1
1 is subtracted from the value
the value is divided by 1
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 2 of 2
Comments:
1809981010 MultipleChoice 12 True
0 1809981010 MultipleChoice 12
5. Question : (TCO 4) When a loop-control variable is not altered during loop
execution, a(n) ______ loop may result.
Student Answer:
decrement
indeterminate
infinite
default
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 2 of 2
Comments:
1809981011 MultipleChoice 15 True
1. Question : (TCO 4) A variable that determines if a loop will continue is known as a
____.
Student Answer:
loop marker
counter
looping variable
loop-control variable
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 0 of 2
Comments:
1809981007 MultipleChoice 3 False
0 1809981007 MultipleChoice 3
2. Question : (TCO 4) What is the name for the statements that are repeated during
loop execution?
Student Answer:
Loop body or code block
Decision statements
Loop group
Loop variables
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 0 of 2
Comments:
1809981008 MultipleChoice 4 False
0 1809981008 MultipleChoice 4
3. Question : (TCO 4) Which piece of pseudocode represents incrementing the loop-
control variable called rep?
Student Answer:
rep = 1
while (rep <= 10)
, rep = rep + 1
print "warning"
Instructor The counter variable is incremented.
Explanation:
Points Received: 2 of 2
Comments:
1809981009 MultipleChoice 7 True
0 1809981009 MultipleChoice 7
4. Question : (TCO 4) When a value is incremented by 1, ____.
Student Answer:
1 is added to the value
the value is multiplied by 1
1 is subtracted from the value
the value is divided by 1
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 2 of 2
Comments:
1809981010 MultipleChoice 12 True
0 1809981010 MultipleChoice 12
5. Question : (TCO 4) When a loop-control variable is not altered during loop
execution, a(n) ______ loop may result.
Student Answer:
decrement
indeterminate
infinite
default
Instructor See Chapter 2 in the textbook and the Week 4 lecture.
Explanation:
Points Received: 2 of 2
Comments:
1809981011 MultipleChoice 15 True