Hey there again, welcome to the merge of Mastery #11 and Mastery #12.

In this post, I’m going to show you how to create and call a function.

Fist of all, let me tell you that a function is “A named sequence of statements that performs some useful function. Functions may or may not take parameters, and may or may not produce a result” (Allen, 2009).

The structure of a function is:

type NAME (parameters) {

Statements

}

Reference:

Allen B., D. (2009). How to Think Like a Computer Scientist.  Retrieved from http://greenteapress.com/thinkcpp/

CC BY 4.0 MASTERIES #11 & #12: Creating and calling Functions by Ana Gloria Angulo is licensed under a Creative Commons Attribution 4.0 International License.