Question 2
AQA Computer Science June 2023 Paper 1C (8525/1C)GCSE3 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
Question text
2 box Figure 2 shows an algorithm that uses integer division which has been represented using pseudo-code. • Line numbers are included but are not part of the algorithm. Figure 2 1 again True 2 WHILE again = True 3 a USERINPUT 4 IF a > 0 THEN 5 counter 0 6 WHILE a > 0 7 a a DIV 3 8 counter counter + 1 9 ENDWHILE 10 ELSE 11 again False 12 ENDIF 13 OUTPUT a 14 ENDWHILE Integer division is the number of times one integer divides into another, with the remainder ignored. For example: • 14 DIV 5 evaluates to 2 • 25 DIV 3 evaluates to 8 2.1 Where is iteration first used in the algorithm in Figure 2? Shade one lozenge. [1 mark] A Line number 2 B Line number 4 C Line number 6 D Line number 11 2.2 In the algorithm in Figure 2, what will be output when the user input is 10? box Shade one lozenge. [1 mark] A 0 B 1 C 2 D 4 2.3 In the algorithm in Figure 2, what is the largest possible value of the variable counter when the user input is 36? Shade one lozenge. [1 mark] A 0 B 2 C 4 D 5