The following pseudocode is not working properly. The message should display fiv
ID: 3687490 • Letter: T
Question
The following pseudocode is not working properly. The message should display five times. This is not working because the programmer made which common loop mistake?
Declarations
num count
string message = ”Good”
while count < 5
output message
count = count + 1
endwhile
a. Neglecting to initialize the loop control variable
b. Neglecting to alter the loop control variable
c. Using the wrong comparison with the loop control variable
d. Including statements inside the loop that belong outside the loop
Explanation / Answer
a. Neglecting to initialize the loop control variable
make count=0
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.