Photo AI

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 icon

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-AQA-GCSE Computer Science-Question 3-2021-Paper 1.png

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

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.

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;