Edexcel IGCSEComputer ScienceGeneral Applications4 Marks
Consider the following pseudocode: ```pseudocode DECLARE num1 : INTEGER DECLARE num2 : INTEGER DECLARE result : INTEGER INPUT num1 INPUT num2 IF num1 > num2 THEN result = num1 - num2 ELSE result = num2 - num1 END IF OUTPUT result ```
- (a)State the purpose of the `DECLARE` statements.[1]
- (b)Identify the output if `num1` is 7 and `num2` is 12.[1]
- (c)Describe what this algorithm calculates.[2]
Mark scheme
Marking points from the official mark scheme. The mark or mark type is shown in brackets.
- (a) B1 for 'To declare / create variables' or 'To assign a data type to variables' or 'To reserve memory for variables'.
- (b) B1 for '5'.
- (c) B1 for stating 'It calculates the difference between two numbers'.
- B1 for further qualification, e.g., 'It calculates the absolute / positive difference between two numbers' or 'It calculates the magnitude of the difference regardless of order'.
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 →