Exam 6: User-Defined Functions
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C50 Questions
Exam 3: Inputoutput50 Questions
Exam 4: Control Structures I Selection50 Questions
Exam 5: Control Structures II Repetition50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the String Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records Structs50 Questions
Exam 10: Classes and Data Abstraction49 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Searching, Sorting and the Vector Type50 Questions
Exam 17: Linked Lists50 Questions
Exam 18: Stacks and Queues50 Questions
Select questions type
The ____________________ of an identifier refers to where in the program an identifier is accessible (visible).
Free
(Short Answer)
4.9/5
(42)
Correct Answer:
scope
The output of the statement: cout << tolower('$') << endl;
Is ____.
Free
(Multiple Choice)
4.7/5
(29)
Correct Answer:
A
Which of the following function prototypes is valid?
Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
A
Once you write and properly debug a function, you can use it in the program (or different programs) again and again without having to rewrite the same code repeatedly.
(True/False)
4.7/5
(38)
Assume that all variables are properly declared. The following statement in a value-returning function is legal.
if (x % 2 == 0)
return x;
else
return x + 1;
(True/False)
5.0/5
(37)
Assume the following. static_cast<int>('a') = 97
Static_cast<int>('A') = 65
The output of the statement:
Cout << static_cast<int>(tolower('B')) << endl; is ____.
(Multiple Choice)
4.7/5
(37)
The data type of a variable in a return statement must match the function type.
(True/False)
4.8/5
(39)
Given the following function: int next(int x)
{
Return (x + 1);
}
What is the output of the following statement?
Cout << next(next(5)) << endl;
(Multiple Choice)
5.0/5
(33)
Given the following function prototype: double tryMe(double, double);, which of the following statements is valid? Assume that all variables are properly declared.
(Multiple Choice)
4.8/5
(31)
The program that tests a function is called a(n) ____________________ program.
(Short Answer)
4.9/5
(29)
____________________ identifiers are not accessible outside of the function (block).
(Short Answer)
4.8/5
(38)
When you attach & after the dataType in the formal parameter list of a function, the variable following that dataType becomes a(n) ____________________ parameter.
(Short Answer)
4.8/5
(35)
The following function heading in a C++ program is valid:
int funcExp(int u, char v, float g)
(True/False)
4.9/5
(39)
A variable listed in a header is known as a(n) ____ parameter.
(Multiple Choice)
4.8/5
(39)
Given the following function prototype: int test(float, char);, which of the following statements is valid?
(Multiple Choice)
4.8/5
(42)
The execution of a return statement in a user-defined function terminates the program.
(True/False)
4.9/5
(33)
The following return statement returns the value 10.
return 10, 16;
(True/False)
4.8/5
(37)
The statement: return 37, y, 2 * 3; returns the value ____.
(Multiple Choice)
4.7/5
(32)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)