The flowchart shows an algorithm that should allow 60 test results to be entered into the variable Score. Each test result is checked to see if it is 50 or more. If it is, the test result is assigned to the Pass array. Otherwise, it is assigned to the Fail array. [Figure 4.1]
- (a)Complete this flowchart:[6]
- (b)Write a pseudocode routine that will check that each test result entered into the algorithm is between 0 and 100 inclusive.[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.
- [6] One mark per mark point, max six
- MP1 input box
- MP2 correct check of Score
- MP3 assign Score to Pass correctly
- MP4 assign Score to Fail correctly
- MP5 increment both array counters
- MP6 correct check of number of scores
- START
- PassCount ← 0
- FailCount ← 0
- Count←0
- INPUT Score
- Yes IS Score >= No
- 50?
- Pass [PassCount) ← Score
- Fail [FailCount) ← Score
- PassCount ← PassCount + 1
- FailCount FailCount + 1
- Count Count + 1
- No IS Count =
- Yes 60?
- END
- [4] One mark per mark point, max four
- MP1 appropriate conditional loop structure
- MP2 correct identification of invalid input
- MP3 appropriate error message
- MP4 repeated input of score until correct
- WHILE Score < 0 OR Score > 100 (DO)
- OUTPUT "Your entry must be between 0 and 100, inclusive, please try again "
- INPUT Score
- ENDWHILE
- Or:
- REPEAT
- IF Score < 0 OR Score > 100
- THEN
- OUTPUT "Your entry must be between 0 and 100, inclusive, please try again "
- INPUT Score
- ENDIF
- UNTIL Score >= 0 AND Score <= 100
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 →