Question 2

AQA Computer Science June 2024 Paper 1A (8525/1A)GCSE5 marks

On the specification

2.1
3.2 Programming
2.2
3.1 Fundamentals of algorithms3.2 Programming
2.3
3.1 Fundamentals of algorithms3.2 Programming
2.4
3.2 Programming
2.5
3.1 Fundamentals of algorithms3.2 Programming
Question text

2 Figure 2 shows an algorithm, represented using pseudo-code. box • Line numbers are included but are not part of the algorithm. Figure 2 1 num  USERINPUT 2 IF NOT(num > 1) OR num > 20 THEN 3 OUTPUT "False" 4 ELSEIF num > 1 AND num < 15 THEN 5 OUTPUT "Almost" 6 ELSEIF num MOD 5 = 0 THEN 7 OUTPUT "True" 8 ELSE 9 OUTPUT "Unknown" 10 ENDIF The modulus operator is used to calculate the remainder after dividing one integer by another. For example: • 14 MOD 3 evaluates to 2 • 24 MOD 5 evaluates to 4 2.1 Where is a relational operator first used in the algorithm in Figure 2? Shade one lozenge. [1 mark] A Line number 1 B Line number 2 C Line number 3 D Line number 6 2.2 In the algorithm in Figure 2, what will be the output when the user input is 5? box Shade one lozenge. [1 mark] A Almost B False C True D Unknown 2.3 Which value input by the user would result in True being output by the algorithm in Figure 2? Shade one lozenge. [1 mark] A -1 B 10 C 20 D 21 2.4 Rewrite line 2 from the algorithm in Figure 2 without using the NOT operator. The algorithm must still have the same functionality. [1 mark] 2.5 A user inputs a value into the algorithm in Figure 2. State one value that the user could input that would result in an output of Unknown [1 mark]