Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
Question 59

An algorithm is designed to monitor an automated greenhouse's weekly crop yields:

1  total_yield ← 0
2  days ← 1
3  IF sensor_active = True THEN
4      WHILE days ≤ 7 AND total_yield < 500
5          daily_harvest ← READ_INPUT()
6          IF daily_harvest > 100 THEN
7              total_yield ← total_yield + daily_harvest
8          ELSE
9              FOR k ← 1 TO 2
10                 SEND_ALERT("Low Yield")
11             ENDFOR
12         ENDIF
13         days ← days + 1
14     ENDWHILE
15 ENDIF

Where is iteration first used in this algorithm?

A

Line 3

B

Line 4

C

Line 6

D

Line 9

Markscheme

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms

208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank