Four pseudocode statements and five pseudocode uses are shown.
- (a)Draw one line to link each pseudocode statement to the most appropriate pseudocode use. Not all pseudocode uses will be required. Pseudocode statement CALL Colour(NewColour) Value ← (A1 + A2 + A3) / 3 Loop1 ← Loop1 + 1 IF Count > 7 THEN X1 ← 0 Pseudocode use counting finding an average totalling using a conditional statement using a procedure[4]
- (b)A one-dimensional (1D) array called Temperatures[] has 25 elements beginning at index 1. It holds values that range between –20 and 100 inclusive. Write a pseudocode algorithm using a single loop to find the lowest value in this array and output the result only once. You do not need to declare or populate this array.[4]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2023). The mark or mark type is shown in brackets.
- [4] One mark for each correct line.
- CALL Colour (NewColour) -> using a procedure
- Value ← (A1 + A2 + A3) / 3 -> finding an average
- Loop1 ← Loop1 + 1 -> counting
- IF Count > 7 THEN X1 ← 0 -> using a conditional statement
- [4] One mark per mark point, max four
- MP1 initialise a variable to store the lowest number set to a high value (at least 100) / first value in the array
- MP2 loop structure to iterate 25 times
- MP3 use of IF to check if the array element is less than the current lowest value
- MP4 ...if it is, set this to the lowest value
- MP5 output the result (with an appropriate message) after the loop
- Example answer: Min ← 100 FOR Count ← 1 TO 25 IF Temperatures [Count] < Min THEN Min ← Temperatures [Count] ENDIF NEXT Count OUTPUT "The lowest temperature is ", Min
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 →