Designing, creating and refining algorithms
42
0/2

A communications satellite has eight solar panels numbered from 0 to 7.

The power output (in watts) generated by each panel is stored in an array named power.

The index of the power array represents the panel number.

Array power

Index01234567
Data451203855291442

The following program is intended to calculate and output the total power generated across all eight panels.

for k = 1 to 7
    total = 0
    total = total + power[k]
next k
print(total)

When tested, the program is found to contain two logic errors.

Describe how the program can be refined to remove these logic errors.

[2]

Designing, creating and refining algorithms Questions

Practise OCR GCSE Computer Science Designing, creating and refining algorithms with exam-style questions for GCSE Computer Science. 50 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Designing, creating and refining algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Designing, creating and refining algorithms