8.3

Procedures and functions

10 flashcards to master Procedures and functions

Smart Spaced Repetition

Rate each card Hard, Okay, or Easy after flipping. Your progress is saved and cards are scheduled for optimal review intervals.

Definition Flip

Define the term 'procedure' in programming, and state its primary purpose.

Answer Flip

A procedure (or subroutine) is a block of code that performs a specific task. Its primary purpose is to modularize code, making it reusable and easier to manage by breaking down larger programs into smaller, self-contained units.

Key Concept Flip

Explain the difference between a 'function' and a 'procedure'.

Answer Flip

Both functions and procedures are reusable blocks of code. A function, unlike a procedure, *must* return a value after execution. Procedures may or may not return values.

Definition Flip

What is a 'parameter' in the context of procedures and functions? Give an example.

Answer Flip

A parameter is a variable that is passed into a procedure or function when it is called.

Example: In `procedure calculateArea(length, width)`, `length` and `width` are parameters.
Definition Flip

What is an 'argument' in the context of procedures and functions? How does it relate to a parameter?

Answer Flip

An argument is the actual value that is passed to a procedure or function when it is called, corresponding to a parameter in the function definition. For

Example: If calling `calculateArea(5, 10)`, 5 and 10 are the arguments.
Definition Flip

Explain what is meant by 'returning a value' from a function. Provide a simple example.

Answer Flip

Returning a value means that a function sends a result back to the part of the code that called the function.

Example: a function `add(x,y)` could `return x + y;`, with the sum then used elsewhere.
Definition Flip

Answer Flip

Definition Flip

Answer Flip

Definition Flip

Answer Flip

Definition Flip

Explain the process of 'calling' a procedure or function.

Answer Flip

Calling a procedure or function means executing the code within that block. This is done by using the procedure/function name followed by parentheses (containing arguments, if any).

Example: `calculateArea(5,10);`
Definition Flip

Answer Flip

Review the material

Read revision notes with definitions, equations, and exam tips.

Read Notes

Test yourself

Practice with MCQ questions to check your understanding.

Take Quiz
8.2 Data structures 9.1 Database concepts

Key Questions: Procedures and functions

Define the term 'procedure' in programming, and state its primary purpose.

A procedure (or subroutine) is a block of code that performs a specific task. Its primary purpose is to modularize code, making it reusable and easier to manage by breaking down larger programs into smaller, self-contained units.

What is a 'parameter' in the context of procedures and functions? Give an example.

A parameter is a variable that is passed into a procedure or function when it is called.

Example: In `procedure calculateArea(length, width)`, `length` and `width` are parameters.
What is an 'argument' in the context of procedures and functions? How does it relate to a parameter?

An argument is the actual value that is passed to a procedure or function when it is called, corresponding to a parameter in the function definition. For

Example: If calling `calculateArea(5, 10)`, 5 and 10 are the arguments.
Explain what is meant by 'returning a value' from a function. Provide a simple example.

Returning a value means that a function sends a result back to the part of the code that called the function.

Example: a function `add(x,y)` could `return x + y;`, with the sum then used elsewhere.

About Procedures and functions (8.3)

These 10 flashcards cover everything you need to know about Procedures and functions for your Cambridge IGCSE Computer Science (0478) exam. Each card is designed based on the official syllabus requirements.

What You'll Learn

How to Study Effectively

Use the Study Mode button above to test yourself one card at a time. Try to answer each question before flipping the card. Review cards you find difficult more frequently.

Continue Learning

After mastering Procedures and functions, explore these related topics: