An algorithm has three steps. It will: 1. repeatedly input a pair of numeric values A and B 2. count the number of pairs that are input until A has been greater than B 10 times 3. output the number of pairs that were input.
- (a)Complete the program flowchart.[5]
- (b)Step 1 of the algorithm is changed. A variable ThisSequence is used to enter a sequence of 10 pairs of numeric values, using a single input statement. Following the input of ThisSequence the revised algorithm will extract the pairs of numbers. Describe the variable ThisSequence and how the numbers are extracted.[2]
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 2024). The mark or mark type is shown in brackets.
- [5] One mark per outlined region:
- 1 Initialise both counts
- 2 Increment Tries every time a pair is input
- 3 Compare A > B and increment Count if TRUE
- 4 Test for Count = 10 (10th time A > B) – MUST include Yes / No labels
- 5 If so output Tries, otherwise loop
- [2] One mark per point:
- 1 A (variable of type) string will be input // by example e.g. “67,72”
- 2 A special / identified character would need to be used to separate each numeric value // all numbers are fixed length
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 →