StudyBrixFree worksheets, study guides and courses

Computer science · lesson 3 of 4

Functions and decomposition

A reusable named block that can accept inputs and return a result.

University8 practice questionsNotes + worked examples

Learn the ideas

Prerequisites: Basic computer literacy.

Function

A reusable named block that can accept inputs and return a result.

Parameter

A local name representing an input in a function definition.

Return value

The result a function sends back to its caller.

Decomposition

Breaking a larger problem into smaller, testable parts.

Worked examples

Example 1

Which term best matches this description: A reusable named block that can accept inputs and return a result.

Function is the matching concept in this lesson.

Function

Example 2

Which term best matches this description: A local name representing an input in a function definition.

Parameter is the matching concept in this lesson.

Parameter

Check your understanding

8 questions

Decimals or fractions are accepted for numeric answers. Proofs and written responses use sample answers and require human marking. This is practice, not a protected examination.

1 Which term best matches this description: A reusable named block that can accept inputs and return a result.

Show answer and explanation

Function

Function is the matching concept in this lesson.

2 Which term best matches this description: A local name representing an input in a function definition.

Show answer and explanation

Parameter

Parameter is the matching concept in this lesson.

3 Which concept would you apply first in a situation where the result a function sends back to its caller.

Show answer and explanation

Return value

The scenario directly calls for Return value.

4 Name the concept described as: Breaking a larger problem into smaller, testable parts.

Show answer and explanation

Decomposition

The intended concept is Decomposition.

5 Which statement about Function is most accurate?

Show answer and explanation

A reusable named block that can accept inputs and return a result.

The definition in the lesson notes gives the required condition.

6 Explain one important difference between Function and Parameter.

Sample answer and marking guidance

Function: A reusable named block that can accept inputs and return a result. Parameter: A local name representing an input in a function definition.

Credit a clear distinction using both definitions and an appropriate example if supplied.

7 Give a short example showing how Return value would be used in practice.

Sample answer and marking guidance

A valid example should demonstrate this idea: The result a function sends back to its caller.

Credit a relevant scenario that applies the concept rather than merely naming it.

8 Summarize why Decomposition matters in the lesson “Functions and decomposition”.

Sample answer and marking guidance

Decomposition matters because Breaking a larger problem into smaller, testable parts.

Credit the core purpose, scope and any important limitation from the notes.

Further reading and review references

These are reference links, not copied exercises, institutional endorsement or proof of independent review.