Question 3
AQA Computer Science Specimen Paper 1A (8525/1A)GCSE5 marks
On the specification
- 3.1
- 3.2 Programming
- 3.2
- 3.2 Programming
- 3.3
- 3.2 Programming
- 3.4
- 3.2 Programming
- 3.5
- 3.2 Programming
Question text
3 The algorithm in Figure 2 has been developed to automate the quantity of dog biscuits to put in a dog bowl at certain times of the day. • Line numbers are included but are not part of the algorithm. Figure 2 1 time USERINPUT 2 IF time = 'breakfast' THEN 3 q 1 4 ELSE IF time = 'lunch' THEN 5 q 4 6 ELSE IF time = 'dinner' THEN 7 q 2 8 ELSE 9 OUTPUT 'time not recognised' 10 ENDIF 11 FOR n 1 TO q 12 IF n < 3 THEN 13 DISPENSE_BISCUIT('chewies') 14 ELSE 15 DISPENSE_BISCUIT('crunchy') 16 ENDIF 17 ENDFOR 3.1 Shade one lozenge which shows the line number where selection is first used in the algorithm shown in Figure 2. [1 mark] A Line number 2 B Line number 4 C Line number 9 D Line number 12 3.2 Shade one lozenge which shows the line number where iteration is first used in the algorithm shown in Figure 2. [1 mark] A Line number 1 B Line number 8 C Line number 11 D Line number 13 3.3 Shade one lozenge which shows how many times the subroutine DISPENSE_BISCUIT would be called if the user input is 'breakfast' in Figure 2. [1 mark] A 1 subroutine call B 2 subroutine calls C 3 subroutine calls D 4 subroutine calls 3.4 Shade one lozenge which shows the data type of the variable time in the algorithm shown in Figure 2. [1 mark] A Date/Time B String C Integer D Real 3.5 State how many times the subroutine DISPENSE_BISCUIT will be called with the parameter 'chewies' if the user input is 'lunch' in Figure 2. [1 mark]