0 of 6 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 6 Questions answered correctly
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
What technique do we use to identify errors in our code?
We cannot use flowcharts when trying to identify errors in an algorithm.
Look at the following pseudocode:
number1 ← USERINPUT
number2 ← USERINPUT
result ← (number1 + number2) / 2
OUTPUT result
Either through visual inspection or using a trace table, identify the purpose of this algorithm.
Look at the following code:
number ← USERINPUT
IF number < 5 THEN
OUTPUT 'A'
ELSE
OUTPUT 'B'
ENDIF
Complete the trace table for this algorithm, when the numbers 2, 9, 1 & 3 are input.
Number | Output |
---|---|
2 | |
9 | |
1 | |
3 |
Look at the following code:
total ← 0
FOR x ← 0 TO 4
total ← total + 1
ENDFOR
Complete the trace table for this algorithm.
x | total |
---|---|
0 | |
Look at the following code:
FOR counter ← 0 TO 4
result ← counter * 2
ENDFOR
Complete the trace table for this algorithm.
counter | result |
---|---|