An algorithm processes daily rainfall measurements stored in an array.
2 # Daily Rainfall
3 SET daysCount TO 0
4 SET totalRain TO 0
5 SET averageRain TO 0
6
7 FOR EACH reading FROM rainfallArray DO
8 SET daysCount TO daysCount + 1
9 SET totalRain TO totalRain + reading
10 SEND totalRain TO DISPLAY
11 END FOREACH
12
13 SET averageRain TO totalRain DIV daysCount
14 SEND averageRain TO DISPLAY
State the process being carried out at line 7 of the algorithm.
50 exam-style questions on Edexcel GCSE Computer Science Constructs, covering Structural components of programs and Writing programs with control constructs. Each one has a worked solution and a mark scheme showing where the marks go.