Photo AI

Here is the pseudo-code for an algorithm that determines the classification of an item - Edexcel - GCSE Computer Science - Question 4 - 2018 - Paper 1

Question icon

Question 4

Here-is-the-pseudo-code-for-an-algorithm-that-determines-the-classification-of-an-item-Edexcel-GCSE Computer Science-Question 4-2018-Paper 1.png

Here is the pseudo-code for an algorithm that determines the classification of an item. SET maxWeights TO [0, 100, 750, 2000, 20000] SET typeItem TO ["Too small", "... show full transcript

Worked Solution & Example Answer:Here is the pseudo-code for an algorithm that determines the classification of an item - Edexcel - GCSE Computer Science - Question 4 - 2018 - Paper 1

Step 1

State the name for this type of error.

96%

114 rated

Answer

Logic error.

Step 2

Identify the error in Line 11 and reconstruct pseudo-code.

99%

104 rated

Answer

The loop never executes because 'found' is initialized to False. Corrected line: WHILE (found == False) DO.

Step 3

Identify the error in Line 18 and reconstruct pseudo-code.

96%

101 rated

Answer

It prints the wrong item type. It prints the item to the right of the correct one. Corrected line: SEND typeItem[i] TO DISPLAY.

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;