GCSEBeast

Subroutines, arrays and files

GCSE Computer Science practice questions on subroutines, arrays and files. Try 3 for free below — with hints, the answer and why the wrong answers are tempting. GCSE Beast has 20 questions on this topic.

Question 1 of 3Difficulty ●●●●●

A running app uses this function to convert a distance:

FUNCTION ToMiles(Kilometres : REAL) RETURNS REAL RETURN Kilometres * 0.62ENDFUNCTION

Which term describes Kilometres in the first line of the function?

Question 2 of 3Difficulty ●●●●●

Priya's quiz game has a procedure with the header PROCEDURE ShowLevel(Level : INTEGER). The procedure is written once, near the top of the program. Further down, a CALL ShowLevel statement appears in four different places, each with a different level number in the brackets.

Which statement is correct?

Question 3 of 3Difficulty ●●●●●

A game uses this pseudocode:

DECLARE Score : INTEGER PROCEDURE Bonus(Points : INTEGER) DECLARE Score : INTEGER Score ← Points * 2 OUTPUT ScoreENDPROCEDURE Score ← 5CALL Bonus(4)OUTPUT Score

What is output?