So all it needs to define a function is to declare the parameters (and its types, since Scala is a statically typed language) on which the function will operate and give a definition on how the result is calculated, typically in terms of the the given parameters.