Identify errors in given algorithms and suggest: past paper questions
Real questions on identify errors in given algorithms and suggest
The newest 20 of 116 written questions. Open one to see it on the real paper.
- 0478/21 · May/June 2026 · Q5a[2]
Write the pseudocode to generate a whole random number between 1 and 1000 inclusive and store it in the variable GeneratedNumber
See it on the paper → - 0478/21 · May/June 2026 · Q11[5]
The function Power(FirstNumber, SecondNumber) returns the value of FirstNumber raised to the power of SecondNumber. FirstNumber and SecondNumber are integers. Write pseudocode statements to: • • define the function call the function with the variables A and B and store the return value in the variable Value function de...
See it on the paper → - 0478/21 · May/June 2026 · Q12[15]
A weather monitoring station records the number of minutes of sunshine for each day of a month. The one‑dimensional (1D) array Sunshine[] is used to store the number of minutes of sunshine for each day. The index of the array represents the day. The one‑dimensional (1D) array MonthDays[] contains the number of days in...
See it on the paper → - 0478/22 · May/June 2026 · Q5a[4]
error 1 line number correction error 2 line number correction (a) Identify the line numbers of four errors in the pseudocode and suggest corrections. error 4 line number correction correction error 3 line number
See it on the paper → - 0478/22 · May/June 2026 · Q5c[2]
The algorithm stops if the account number is not found in the array. Write the pseudocode statements to change the algorithm to inform the user that the account number has not been found in the array. Clearly state where in the original algorithm your new statements would be placed. Do not rewrite the whole algorithm.
See it on the paper → - 0478/23 · May/June 2026 · Q4a[4]
Identify the line numbers of four errors in the pseudocode and suggest corrections. error 1 line number correction error 2 line number correction error 3 line number correction error 4 line number correction
See it on the paper → - 0478/23 · May/June 2026 · Q9[6]
Outline two techniques that can be used to create a maintainable program.
See it on the paper → - 0478/22 · February/March 2026 · Q2c[6]
Write the pseudocode for an algorithm to perform a validation check on each number as it is input to meet the following criteria: • • • • Input 20 numbers, one at a time. If a number is negative, store it in the current element of array NegNumbers[] If a number is not negative, ask for it to be input again until a nega...
See it on the paper → - 0478/22 · February/March 2026 · Q4[1]
Tick (3) one box to identify which of the following does not help to create a maintainable program. A Use meaningful identifiers for variable names. B Remove blank lines to make the program code shorter. C Use procedures and functions. D Use the commenting feature provided by the programming languages. Turn over
See it on the paper → - 0478/22 · February/March 2026 · Q5a[5]
Identify the line numbers of five errors in the pseudocode and suggest corrections. error 1 line number correction error 2 line number correction error 3 line number correction correction error 4 line number error 5 line number correction
See it on the paper → - 0478/22 · February/March 2026 · Q5b[4]
Write the pseudocode for an algorithm, using nested iteration, to output the contents of Names[]
See it on the paper → - 0478/22 · February/March 2026 · Q6c[3]
As currently written, the algorithm may be difficult to understand if it was used as a program. Identify three improvements that could be made to the algorithm to make it more user friendly.
See it on the paper → - 0478/21 · October/November 2025 · Q3[1]
Tick (✓) one box to identify the operator that returns the quotient of a calculation with the fractional part discarded. A / B DIV C ^
See it on the paper → - 0478/21 · October/November 2025 · Q4b[2]
The final cost of the order after the discount may have more than 2 decimal places. Write a pseudocode statement to set the final cost of the order to 2 decimal places. You do not need to rewrite the whole algorithm.
See it on the paper → - 0478/21 · October/November 2025 · Q6a[4]
Identify the line numbers of the four errors in the pseudocode and suggest a correction for each error. Error 1 line number Correction Error 2 line number Correction Error 3 line number Correction Error 4 line number Correction
See it on the paper → - 0478/22 · October/November 2025 · Q1[1]
The result of the arithmetic operation 4 ^ 2 is A 2 B 8 C 16 Tick (✓) one box to complete this sentence.
See it on the paper → - 0478/22 · October/November 2025 · Q2a[5]
Identify the line numbers of five errors in the pseudocode and suggest a correction for each error. Error 1 line number Correction Error 2 line number Correction Error 3 line number Correction Error 4 line number Correction Error 5 line number Correction
See it on the paper → - 0478/22 · October/November 2025 · Q2b(i)[4]
Complete the pseudocode for PROCEDURE NewData PROCEDURE NewData( ) 1 TO FOR Row FOR Column INPUT 1 TO 4
See it on the paper → - 0478/22 · October/November 2025 · Q2b(ii)[2]
Write the pseudocode to input the number of new contacts and to use procedure NewData. A variable declaration is not required.
See it on the paper → - 0478/23 · October/November 2025 · Q1[3]
Give three ways of creating a maintainable program.
See it on the paper →
What examiners said
Comprehensive responses • Most candidates wrote a pseudocode algorithm containing the majority of the required elements. Limited responses • Some candidates incorrectly mixed Python code in with their pseudocode statements. • Some candidates did not include all of the necessary elements to give a comprehensive response, such as not enabling the number to be re-input until a negative number is inp...
— Examiner report, February/March 2026, 0478/22 Q2(c) (Cambridge)
Comprehensive responses • Most candidates correctly ticked option B to show their understanding of the meaning of a maintainable program. Limited responses • Options A, C and D were common incorrect answers, where candidates had misread the question and missed the word not.
— Examiner report, February/March 2026, 0478/22 Q4 (Cambridge)
Comprehensive responses • Some candidates spotted and corrected most of the errors in the given algorithm. • Most candidates spotted and corrected some of the errors in the given algorithm. Limited responses • Some candidates correctly identified lines of code that contained errors and did not offer an appropriate correction. • Some candidates introduced new errors within their corrected response...
— Examiner report, February/March 2026, 0478/22 Q5(a) (Cambridge)
Past papers, syllabus and examiner reports © UCLES (Cambridge University Press & Assessment). Questions are matched to topics from the official syllabus. AssessPro is independent and not endorsed by Cambridge.