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
What is the data type of the following function prototype's return value?
Int myFunction(double);
Free
(Multiple Choice)
4.8/5
(27)
Correct Answer:
A
A __________ argument is passed to a parameter when the actual argument is left out of the function.
Free
(Multiple Choice)
4.8/5
(38)
Correct Answer:
D
What will the following code display?
#include <iostream>
using namespace std;
void doSomething(int);
int main()
{
int x = 2;
cout << x << endl;
doSomething(x);
cout << x << endl;
return 0;
}
void doSomething(int num)
{
num = 0;
cout << num << endl;
}
Free
(Multiple Choice)
4.7/5
(40)
Correct Answer:
A
What will the following code display?
#include <iostream>
using namespace std;
int getValue(int);
int main()
{
int x = 2;
cout << getValue(x) << endl;
return 0;
}
int getValue(int num)
{
return num + 5;
}
(Multiple Choice)
4.8/5
(40)
What will the following code display?
#include <iostream>
using namespace std;
void doSomething(int&);
int main()
{
int x = 2;
cout << x << endl;
doSomething(x);
cout << x << endl;
return 0;
}
void doSomething(int& num)
{
num = 0;
cout << num << endl;
}
(Multiple Choice)
4.7/5
(32)
If a function is called more than once in a program, the values stored in the function's local variables do not _________ between function calls.
(Multiple Choice)
4.9/5
(36)
It is not considered good programming practice to declare all your variables globally.
(True/False)
4.9/5
(28)
In the following function prototype, how many parameter variables does this function have?
Int myFunction(double, double, double);
(Multiple Choice)
4.8/5
(36)
A(n) __________ is information that is passed to a function, and a(n) __________ is information that is received by a function.
(Multiple Choice)
4.8/5
(28)
A collection of statements that performs a specific task is a(n)
(Multiple Choice)
4.7/5
(33)
The value in this type of variable persists between function calls.
(Multiple Choice)
4.8/5
(42)
Functions are ideal for menu-driven programs. When the user selects a menu item, the program can __________ the appropriate function.
(Multiple Choice)
4.9/5
(40)
Select all that apply. Which of the following statement(s) about global variables is(are) true?
(Multiple Choice)
4.9/5
(41)
Given the following header for a function named computeValue, which of the following is a valid call to the function?
Void computeValue(int value)
(Multiple Choice)
4.9/5
(43)
A function _________ eliminates the need to place a function definition before all calls to the function.
(Multiple Choice)
4.9/5
(27)
It is possible for a function to have some parameters with default arguments and some without.
(True/False)
4.8/5
(34)
This is a dummy function that is called instead of the actual function it represents:
(Multiple Choice)
4.9/5
(34)
Showing 1 - 20 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)