Exam 6: Functions

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

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 _________ variable is declared outside all functions.

(Multiple Choice)
4.9/5
(35)

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) { \quad Int c; \quad c = a + 2; \quad a = a * 3; \quad 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)

Global variables are initialized to zero by default.

(True/False)
4.7/5
(33)

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 \quad int x = 2; 7 \quad showDub(x); 8 \quad cout << x << endl; 9 \quad return 0; 10 } 11 void showDub(int num) 12 { 13 \quad 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 \quad int x = 2; 7 \quad showDub(x); 8 \quad cout << x << endl; 9 \quad return 0; 10 } 11 void showDub(int num) 12 { 13 \quad 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)

A function is executed when it is

(Multiple Choice)
4.9/5
(38)

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

Filters

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