An algorithm is described as follows: 1. Input an integer value. 2. Jump to step 6 if the value is less than zero. 3. Call the function IsPrime() using the integer value as a parameter. 4. Keep a count of the number of times function IsPrime() returns TRUE. 5. Repeat from step 1. 6. Output the value of the count with a suitable message.
- (a)Draw a program flowchart to represent the algorithm.[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 2022). The mark or mark type is shown in brackets.
- [4] One mark per point:
- 1 Initialise Count before loop AND Input NextNum in a loop
- 2 Loop until NextNum < 0 AND OUTPUT statement including Count plus a message
- 3 Use of IsPrime(NextNum) as a function (must return a value)
- 4 Check return value AND increment Count if appropriate
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 →