Correct Answer & Explanation to "Functions that are used in programs and are defined by programmers are called"
a. Programming Layout
b. Program procedure
c. Built-in functions
d. User-defined function
Program procedures are the block of codes that perform a specific task in a program. Procedures are the part of a program. Procedures are also called functions in programming.
Built-in functions are the functions or procedures that are already available in the language. You can use it directly by calling its name supplying the required parameters or arguments.
For example in excel AVERAGE(25,38,46,88.93) results the average value of the numbers supplied in parenthesis. You don't have to define how the calculation should be done, what formula to use and what result should be provided.
User defined functions are the procedure or functions created by programmers or users.
You can create a function in Excel that will return the Top Scorer for given range of mark-sheet. To create that function, you need to define a name of the function (say TOPSCORER) and determine how to input data in the function (accept one, two or more ranges) and then write program codes to sort the input data in ascending order, fetch the name from last record and return that name. Following is a sample algorithm of such user-defined function.
01: function TOPSCORER(name_range, score_range) AS STRING
02: newData=SORT ASCENDING name_range, score_range BY score_range
03: finalRecord= GET last record form newData
04: Return name from finalRecord
Okay! That's the explanation of each of those options in question. According to the discussion above, correct answer is User Defined Functions.
The confusion may still lie among students because the question says Defined by Programmer and correct answer contains User-Defined. Note, here the programmers are users in case of programming. There are programmers who develop programming language and the functions they define in programming language are buit-in functions. Whereas, there are programmers who use that programming language to create their programs and the functions they define for their program (not for programming language) are user-defined functions.