Skip to main content
A-LevelComputer ScienceProgramming9618/23 · May/June 2025 · Q48 Marks

A programmer is developing a new stock control program for a shop owner to produce sales reports.

  1. (a)A text file Sales.txt stores strings representing the number of items sold. The file contains 52 lines, each representing the number of items sold in each week of the year. For example: File line number File data 1 "350" 2 "502" 3 "434" . . 49 "492" 50 "872" 51 "772" 52 "201" The example shows that 502 items were sold in week 2. The owner requires a module to output all week numbers where the number of items sold is greater than 500. Describe an algorithm that produces the required module. Do not include pseudocode statements in your answer.[5]
  2. (b)Once the program has been completed, it is tested using the walkthrough method. Describe the walkthrough method and explain how it can be used to identify errors.[3]

Mark scheme

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

  1. [5] MP1 Open the file (Sales.txt) in read mode and subsequently close
  2. MP2 Read a line (from the text file)
  3. MP3 Convert the line read (string) to a number
  4. MP4 If the number is greater than 500 and then output week number
  5. MP5 Increment week number (must have been Initialised ...)
  6. MP6 Repeat from step 2 for 52 times // Repeat from step 2 until end of file
  7. Max 5
  8. [3] MP1 Going through the program a line / statement at a time // doing a dry run // single-stepping (at run-time with an IDE) // Peer testing/review is carried out
  9. MP2 Creating a trace table
  10. MP3 Draw up test data // draw up list of inputs with expected output // boundary, normal, abnormal data is used
  11. MP4 Errors will be indicated when a variable / output gives an unexpected value
  12. MP5 Faults in the logic of the program can be detected // Errors may be indicated by an unexpected path through the program
  13. Max 3

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
Programming, A-Level Computer Science (syllabus 9618). Structured question, 8 marks.
Source
A-Level Computer Science, May/June 2025 Paper 2 Variant 3, question 4.

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