Choose the correct answer
1. Which of the following is true with regards to functions?
a. A program can have more than one function and they must always return a value to the calling
module.
b. Values that are passed to a function in the calling module are referred to as parameters.
c. You can define your function inside another function as long as you want to use the
functionalities of it.
d. The function procedure will always receive values parameters and it may not alter the original
values.
2. Which of the following statement is true about overloaded functions?
a. Two or more functions with same name and consists of more than one parameter.
b. Two or more functions with the same name but different in their parameter list.
c. Two or more functions and they do not return any value to the calling module.
d. Two more functions with the same number of value and reference parameters.
1.
a. false: Void functions do not return a value after the function executes
b. false: Parameters are the names of the information that we want to use in a function or procedure. The values passed in are called arguments.
c. false: A function cannot be defined inside the another function, but a function can be called inside a another function, because after returning a value the control is given back to calling function.
d. true: You're passing the parameter as an IN parameter - that means you can't change it, which if you think about it, makes sense. It's a constant, in effect.
2.
Answer: b. Two or more functions with the same name but different in their parameter list.
Comments
Leave a comment