logo

Cambridge IGCSE Computer Science practice

Paper 2 structured question: P rogramming concepts

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

At a glance

2

Paper

1

Marks

Topic

P rogramming concepts

Exam-style question

Try this first

Paper 2Algorithms, Programming and Logic1 marks

Understanding the use of functions and procedures in programming.

Description

Functions and Procedures

In a programming language, a function named 'calculateArea' takes two parameters: 'length' and 'width'. It returns the area calculated as length multiplied by width. A procedure named 'displayMessage' takes one parameter 'message' and prints it to the console.

  1. a

    State the difference between a function and a procedure.

    Aim for approximately 1 distinct marking point.

    [1]

0 of 1 part answered

Answer every part before opening the mark scheme.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

Flashcard 1 of 6

Press Space to flip, arrows to move

Related practice questions

Question 1 of 5

Choose an answer, get feedback, then move sideways through the set.

0 of 4 attempted

Paper 2 structured question: P rogramming concepts

Paper 2Algorithms, Programming and Logic3 marks

Description

Variable Scope

Consider the following code snippet: 'globalVar = 10; function example() { localVar = 5; }'. Identify the scopes of 'globalVar' and 'localVar'.

  1. a

    Explain the scope of 'globalVar'.

    Aim for approximately 1 distinct marking point.

    [1]
  2. b

    Explain the scope of 'localVar'.

    Aim for approximately 2 distinct marking points.

    [2]