Chapter
Functions
From ComputerScienceOne by Dr Chris Bourke
Concepts
- What is a mathematical function?
"In mathematics, a function is a mapping from a set of inputs to a set of outputs such that each input is mapped to exactly one output. For example, the function f ( x ) = x 2 maps numeric values to t
- How do functions work in programming languages?
"In programming languages, a function (sometimes called subroutine or procedure) can take multiple inputs and produce one output value. We’ve already seen some examples of these functions. For example
- Why are functions useful in programming?
"Defining and using functions in programming has numerous advantages. The most obvious advantage is that it allows you a way to organize code. By separating a program it into distinct units of code it