CS Paper 2 Answers
CS Paper 2 Answers
IF Number = 20
IF Number =
20
PRINT Number
PRINT Number
(b) State the type of each pseudocode statement. For example, X ← X + Y is totalling.
[3]
(b) Explain how the algorithm could be extended to allow three attempts at inputting the matching
password. Any pseudocode statements used in your answer must be fully explained.
Ans: Use a counter that will allow the conditions in the code to go for 3 times and then stop.
(a) Write a pseudocode routine that sets each element to zero. Use the most suitable loop
structure.