Photo AI

P-Cubed classifies items as letters and packages according to their weight - Edexcel - GCSE Computer Science - Question 4 - 2018 - Paper 1

Question icon

Question 4

P-Cubed-classifies-items-as-letters-and-packages-according-to-their-weight-Edexcel-GCSE Computer Science-Question 4-2018-Paper 1.png

P-Cubed classifies items as letters and packages according to their weight. Here is the pseudo-code for an algorithm that determines the classification of an item. ... show full transcript

Worked Solution & Example Answer:P-Cubed classifies items as letters and packages according to their weight - 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. This occurs because the condition for classifying the item is flawed, leading to incorrect output.

Step 2

Identify the error in Line 11 and construct new lines of pseudo-code that will correct the errors.

99%

104 rated

Answer

Error: The loop never executes (Line 11) because 'found' is initialized to False. Correction: Change Line 11 to 'WHILE (found = False) AND (i < LENGTH(maxWeights)) DO'.

Step 3

Identify the error in Line 18 and construct new lines of pseudo-code that will correct the errors.

96%

101 rated

Answer

Error: It prints the wrong item type (Line 18); it prints the item type to the right of the correct one. Correction: Change Line 18 to '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

;