Exam 6: User-Defined Function
Exam 1: An Overview of Computers and Programming Languages40 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Inputoutput40 Questions
Exam 4: Control Structures I Selection40 Questions
Exam 5: Control Structures Ii Repetition40 Questions
Exam 6: User-Defined Function41 Questions
Exam 7: Namespaces, the Class String, and User-Defined Simple Data Types40 Questions
Exam 8: Arrays40 Questions
Exam 9: Records Structs40 Questions
Exam 10: Classes and Data Abstraction43 Questions
Exam 11: Inheritance and Composition41 Questions
Exam 12: Pointers, Classes, Virtual Functions, and Abstract Classes44 Questions
Exam 13: Operator Overloading and Templates41 Questions
Exam 14: Exception Handling43 Questions
Exam 15: Recursion43 Questions
Exam 16: Linked Lists40 Questions
Exam 17: Stacks and Queue43 Questions
Exam 18: Searching and Sorting Algorithms40 Questions
Exam 19: Binary Trees43 Questions
Exam 20: Graph Algorithms48 Questions
Exam 21: Standard Template Library41 Questions
Select questions type
In C++, a function prototype is the function heading without the body of the function.
Free
(True/False)
4.9/5
(41)
Correct Answer:
True
Which of the following function prototypes is valid?
Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
A
Stream variables (for example, ifstream and ofstream) should be passed by ____________________ to a function.
Free
(Short Answer)
4.9/5
(28)
Correct Answer:
reference
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.8/5
(36)
Functions that do not have a return type are called ____ functions.
(Multiple Choice)
4.8/5
(38)
The statement: return 2 * 3 + 1, 1 + 5; returns the value ____.
(Multiple Choice)
4.9/5
(35)
The output of the statement:cout << pow(2.0, pow(3.0, 1.0)) << endl; is ____.
(Multiple Choice)
4.7/5
(47)
Using functions greatly enhances a program's readability because it reduces the complexity of the function main.
(True/False)
4.8/5
(41)
To use the predefined function tolower, the program must include the header file ____.
(Multiple Choice)
4.8/5
(34)
Given the following function prototype: int myFunc(int, int);
Which of the following statements is valid? Assume that all variables are properly declared.
(Multiple Choice)
4.8/5
(34)
Assume that all variables are properly declared.The following statement in a value-returning function is legal.


(True/False)
4.8/5
(31)
Given the function prototype: double testAlpha(int u, char v, double t);
Which of the following statements is legal?
(Multiple Choice)
4.9/5
(35)
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.7/5
(39)
The output of the statement:cout << tolower('$') << endl; is ____.
(Multiple Choice)
4.8/5
(40)
____________________ parameters are useful in three situations:• When the value of the actual parameter needs to be changed
• When you want to return more than one value from a function
• When passing the address would save memory space and time relative to copying a large amount of data
(Short Answer)
4.9/5
(40)
The ____________________ of a function consists of the function name and its formal parameter list.
(Short Answer)
4.7/5
(34)
A variable or expression listed in a call to a function is called the ____.
(Multiple Choice)
4.9/5
(35)
The output of the statement: cout << pow(3.0, 2.0) + 5 << endl; is ____.
(Multiple Choice)
4.8/5
(34)
Given the following function prototype: int test(float, char);
Which of the following statements is valid?
(Multiple Choice)
4.8/5
(42)
Showing 1 - 20 of 41
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)