Skip to main content
A-LevelComputer ScienceAlgorithm design and problem-solving9618/21 · May/June 2025 · Q210 Marks

A program is being developed to calculate the pay of employees working for a company. A function CalculateBonus () calculates bonus pay based on the value of sales. Bonus pay is calculated as shown in the table. | Value of sales (in dollars) | Bonus pay (in dollars) | |:-----------------------------------|:-----------------------| | below 2000 | 0 | | between 2000 and 4000 inclusive | 10 | | above 4000 | 100 | A flowchart for the function CalculateBonus() has been designed. START Set BonusPay to 0 INPUT ValueOfSales Is ValueOfSales > 4000 ? YES Set BonusPay to 10 NO Is ValueOfSales >= 2000 ? YES Set BonusPay to 100 RETURN BonusPay END

  1. (a)(i)The flowchart contains logic errors. One logic error is that BonusPay will not be set to 10 although the ValueOfSales input is between 2000 and 4000 inclusive. Explain why this error occurs.[1]
  2. (a)(ii)Explain how this error could be corrected.[1]
  3. (b)(i)There are different ways to reduce the risk of errors when developing the new program, such as the use of constants. State a value that could be replaced by a constant in the function CalculateBonus()[1]
  4. (b)(ii)Explain how the use of constants helps to reduce the risk of programming errors.[2]
  5. (b)(iii)One other way that can reduce the risk of errors when writing the program is the use of library routines. Explain how library routines can reduce the risk of programming errors.[1]
  6. (c)All the logic errors have been corrected, and the program has been coded. Identify and describe two other types of error that the program could contain. Type of error Description Type of error Description[4]

This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.

Mark scheme

Marking points from the official mark scheme (May/June 2025). The mark or mark type is shown in brackets.

  1. [1] The two decision boxes are in the wrong order // The first decision symbol is wrong
  2. [1] The first decision should check for values greater than or equal to 2000
  3. [1] Swap around the two decision boxes
  4. [1] The first decision box should check for values greater than or equal to 2000 and the second decision box should check for values above 4000
  5. [1] 2000 / 4000 / 10 / 100
  6. [1] The value cannot be changed // avoids being different in two places
  7. [1] Makes the program easier to understand
  8. [1] Avoids repeatedly writing the same value throughout the program
  9. [1] A change to the value requires a change in only one statement
  10. [1] (The code is) tried and tested so error free
  11. [1] Provides functionality / code that the programmer may find difficult to code themselves
  12. [1] Syntax (error)
  13. [1] Rules of programming language // the language grammar was not followed
  14. [1] Run-time (error)
  15. [1] The program performs an illegal operation

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Algorithm design and problem-solving, A-Level Computer Science (syllabus 9618). Structured question, 10 marks.
Source
A-Level Computer Science, May/June 2025 Paper 2 Variant 1, question 2.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep