Ace the 2025 OCR GCSE Computer Science Challenge – Code Your Way to Success!

Disable ads (and more) with a premium pass for a one time $4.99 payment

Question: 1 / 340

What is the term for a sub program that accepts parameters and returns a value?

Procedure

Function

The term for a subprogram that accepts parameters and returns a value is known as a function. Functions are fundamental building blocks in programming that allow developers to encapsulate code for specific tasks. By accepting parameters, functions can perform operations that depend on the input values provided to them. The return value gives the result of the operations back to the calling code, enabling the use of that result for further calculations or outputs.

In contrast, a procedure typically performs a task without returning a value. A method refers to functions associated with an object or class in object-oriented programming, but not every method has to return a value. Lastly, a class is a blueprint for creating objects that encapsulate data and behavior, rather than focusing solely on reusable code in the form of functions. Hence, the specific attributes of accepting parameters and returning a value define a function more precisely.

Get further explanation with Examzify DeepDiveBeta

Method

Class

Next

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy