Learn in the textbookInput/Output and Procedures & Functions
DefinitionA function (関数) is a named block of processing that hands its result back to the caller as a value.
ExplanationA function receives values when it is called, uses them in its processing, and returns the result to the caller. In the pseudo-language it is declared in the form ○整数型: functionName(整数型: name), where 整数型 is the exam notation for integer type, with the return type before the name and the type and name of each received value inside the parentheses after it. Inside the function, return gives back the value written after it and ends the processing.
AnalogyIt is like the square root key on a calculator: enter a number, press the key, and the result of a fixed calculation comes back.
Memory hookIn Japanese it was once written 函数, and 函 means box. Picture a box that gives back a result when you put a value in.