Exam 6: Functions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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:
Verified

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:
Verified

D

What will the following code display? #include <iostream> using namespace std; void doSomething(int); int main() { \quad int x = 2; \quad cout << x << endl; \quad doSomething(x); \quad cout << x << endl; return 0; } void doSomething(int num) { \quad num = 0; \quad cout << num << endl; }

Free
(Multiple Choice)
4.7/5
(40)
Correct Answer:
Verified

A

What will the following code display? #include <iostream> using namespace std; int getValue(int); int main() { \quad int x = 2; \quad cout << getValue(x) << endl; \quad return 0; } int getValue(int num) { \quad return num + 5; }

(Multiple Choice)
4.8/5
(40)

This statement causes a function to end.

(Multiple Choice)
4.8/5
(33)

What will the following code display? #include <iostream> using namespace std; void doSomething(int&); int main() { \quad int x = 2; \quad cout << x << endl; \quad doSomething(x); \quad cout << x << endl; \quad return 0; } void doSomething(int& num) { \quad num = 0; \quad 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)

You must always furnish an argument with a function call.

(True/False)
4.8/5
(32)

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)

Local variables are initialized to zero by default.

(True/False)
4.7/5
(26)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)