Designing, Creating & Refining Algorithms - GCSE . OCR .
Computer Science
1. An algorithm decides if a number is odd or even. An odd number divided
by 2 will give the remainder 1. The flowchart statements have been written
for the algorithm, but the flowchart is incomplete
2. The following program uses a condition-controlled loop.
a = 20
b = 1
while a >= b
a = a - b
b = b + 2
endwhile
print(b)
3. The following program uses a condition-controlled loop.
x = 10
y = 2
while x > 0
x = x - y
endwhile
print(x)