Write True or False
1. A function prototype only consist of the name of the function as well as
the parameter list.
2. A function prototype in C++ has a local scope as it is only
accessible within the main or the function where they are
declared in.
3. By default all parameters are declared as integer values.
4. The following is a valid C++ call to a function that will calculate the
final results of two assessments:
results = summativeResults (valtest1, vallTtest2, valResults);
5. The following is a valid C++ function header that will determine if the
entered value is a multiple of 3 or not.
Function determineMuliple (valFirst)
1. A function prototype only consist of the name of the function as well as the parameter list.
Answer: False
Explanation: A function also contains the definition of return type along with funcation name and parameter list.
2. A function prototype in C++ has a local scope as it is only accessible within the main or the function where they are declared in.
Answer: False
Explanation: The function has global scope and called from any function outside the main as well.
3. By default all parameters are declared as integer values.
Answer: False
4. The following is a valid C++ call to a function that will calculate the final results of two assessments: results = summativeResults (valtest1, vallTtest2, valResults);
Answer: False
Explanation: The function should be called with two parameters as parameters list and valResult should be returned from the function..
5. The following is a valid C++ function header that will determine if the entered value is a multiple of 3 or not. Function determineMuliple (valFirst)
Ans. True
Comments
Leave a comment