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 - AQA - GCSE Computer Science - Question 3 - 2021 - Paper 1
Question 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 ... show full transcript
Worked Solution & Example Answer: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 - AQA - GCSE Computer Science - Question 3 - 2021 - Paper 1
Step 1
Shade one lozenge which shows how many times the subroutine DISPENSE_BISCUIT would be called if the user input is 'breakfast'
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
When the user inputs 'breakfast', the algorithm assigns the value of q as 1 (line 3). Therefore, the loop (lines 11-17) will run only once, calling the subroutine DISPENSE_BISCUIT once. The correct answer is B: 1 subroutine call.