logo

AQA A-Level Computer Science practice

A subroutine has two parameters and three local variables. Which statement best describes the stack frame created for one call?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

A subroutine has two parameters and three local variables. Which statement best describes the stack frame created for one call?.

  1. A.It can contain the return address, the two parameters and the three local variables
  2. B.It contains only the return address because variables are stored in the program code
  3. C.It contains only the local variables because parameters are stored in the calling subroutine's frame
  4. D.It contains the return address but cannot contain values associated with variables

Answer and explanation

Concise answer

It can contain the return address, the two parameters and the three local variables

Why this is correct

A stack frame holds the information associated with a particular subroutine call. This includes the return address, parameter values and local variables.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions