Still loading. This can take a moment on a slow connection.
Still loading. This can take a moment on a slow connection.
Input values into a one-dimensional array, total them in a loop, and predict the total and the mean.
StartThe program is about to run, from line 1.
DECLARE Scores : ARRAY[1:3] OF INTEGERDECLARE Total : INTEGERDECLARE Index : INTEGERTotal ← 0FOR Index ← 1 TO 3 INPUT Scores[Index] Total ← Total + Scores[Index]NEXT IndexOUTPUT "Mean: ", ROUND(Total / 3, 2)| Total | — |
|---|---|
| Index | — |
Before a line runs, say what it will do: the value it stores, what it outputs, or whether a test is TRUE. Play waits for your answer.
After your first prediction, this says why it works.
Try what you found on the lesson’s 37 marked questions. Practise in One-Dimensional Arrays
Key
A teaching interpreter for the pseudocode the 0478 syllabus writes. It runs a program a line at a time, and stops one that takes more than 2000 steps or outputs more than 200 lines. Names are not case-sensitive, as the syllabus says. An input is read as the data type its variable was declared with. Files are held in the page: each run starts from the files under Files, and nothing is saved. When a FOR loop ends, its counter keeps the last value it ran with.