Note AcademyNote Academy

Computer Science · May / June 2026 · Paper 21 · Question 11

0478

As printed in the paper

The question as text

The function ©Ž«ˆ“ìÀ“£¨|‘’ˆ“ ªˆÉŽ®|‘’ˆ“Ä returns the value of ¬À“£¨|‘’ˆ“ raised to the power of ªˆÉŽ®|‘’ˆ“. ¬À“£¨|‘’ˆ“ and ªˆÉŽ®|‘’ˆ“ are integers. Write pseudocode statements to: • define the function • call the function with the variables { and Í and store the return value in the variable š‹ˆ function definition function call [5]

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme

One mark for each mark point

defining FUNCTION Power with ENDFUNCTION and RETURNS INTEGER/REAL
defining the parameters correctly
correct calculation
return the calculated value
correct function call

Example:

FUNCTION Power(FirstNumber : INTEGER, SecondNumber : INTEGER) RETURNS INTEGER

RETURN FirstNumber ^ SecondNumber

ENDFUNCTION

Function call:

Value ← Power(A, B)

Alternative calculations:

Num ← 1

FOR I ← 1 TO SecondNumber

Num ← Num * FirstNumber

NEXT I

Num ← FirstNumber

FOR I ← 1 TO SecondNumber - 1

Num ← Num * FirstNumber

NEXT I

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.