Exam 6: Functions
Exam 1: Introduction to Computers and Programming47 Questions
Exam 2: Introduction to C62 Questions
Exam 3: Expressions and Interactivity45 Questions
Exam 4: Making Decisions51 Questions
Exam 5: Loops and Files60 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays and Vectors56 Questions
Exam 8: Searching and Sorting Arrays30 Questions
Exam 9: Pointers47 Questions
Exam 10: Characters, C-Strings, and More About the String Class47 Questions
Exam 11: Structured Data46 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes54 Questions
Exam 14: More About Classes46 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions43 Questions
Exam 16: Exceptions and Templates36 Questions
Exam 17: The Standard Template Library38 Questions
Exam 18: Linked Lists41 Questions
Exam 19: Stacks and Queues47 Questions
Exam 20: Recursion27 Questions
Exam 21: Binary Trees39 Questions
Select questions type
This function causes a program to terminate, regardless of which function or control mechanism is executing.
(Multiple Choice)
4.9/5
(36)
When used as parameters, these types of variables allow a function to access the parameter's original argument:
(Multiple Choice)
4.8/5
(33)
A function's return data type must be the same as the function's parameters.
(True/False)
4.8/5
(31)
Given the following function:
void calc (int a, int& b)
{
Int c;
c = a + 2;
a = a * 3;
b = c + a;
}
What is the output of the following code segment that invokes calc():
Int x = 1;
Int y = 2;
Int z = 3;
Calc(x, y);
Cout << x << " " << y << " " << z << endl;
(Multiple Choice)
4.7/5
(31)
If a function does not have a prototype, default arguments may be specified in the __________.
(Multiple Choice)
4.9/5
(38)
Which line in the following program contains the prototype showDub function?
1 #include <iostream>
2 using namespace std;
3 void showDub(int);
4 int main()
5 {
6 int x = 2;
7 showDub(x);
8 cout << x << endl;
9 return 0;
10 }
11 void showDub(int num)
12 {
13 cout << (num * 2) << endl;
14 }
(Multiple Choice)
4.9/5
(34)
Which line in the following program contains the header for the showDub function?
1 #include <iostream>
2 using namespace std;
3 void showDub(int);
4 int main()
5 {
6 int x = 2;
7 showDub(x);
8 cout << x << endl;
9 return 0;
10 }
11 void showDub(int num)
12 {
13 cout << (num * 2) << endl;
14 }
(Multiple Choice)
4.9/5
(31)
You may use the exit() function to terminate a program, regardless of which control mechanism is executing.
(True/False)
4.8/5
(48)
What is the data type of the following function prototype's parameter variable?
Int myFunction(double);
(Multiple Choice)
4.8/5
(35)
Select all that apply. Which of the following must be included in a function header?
(Multiple Choice)
4.7/5
(41)
EXIT_FAILURE and ________ are named constants that may be used to indicate success or failure when the exit() function is called.
(Multiple Choice)
4.8/5
(32)
__________ functions may have the same name as long as their parameter lists are different.
(Multiple Choice)
4.9/5
(37)
The value in a __________ variable persists between function calls.
(Multiple Choice)
4.8/5
(34)
One reason for using functions is to break programs into manageable units or modules.
(True/False)
4.8/5
(32)
A static variable that is defined within a function is initalized only once, the first time it is called.
(True/False)
4.9/5
(29)
This type of variable is defined inside a function and is not accessible outside the function.
(Multiple Choice)
4.9/5
(30)
A parameter is a special purpose variable that is declared inside the parentheses of a function definition.
(True/False)
4.7/5
(40)
Showing 21 - 40 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)