Exam 6: Functions

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

Which line in the following program contains a call to 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
(37)

A local variable and a global variable may not have the same name within a program.

(True/False)
5.0/5
(40)

These types of arguments are passed to parameters automatically if no argument is provided in the function call.

(Multiple Choice)
4.8/5
(42)

It is good programming practice to __________ your functions by writing comments that describe what they do.

(Multiple Choice)
4.7/5
(40)

When a function is called, flow of control moves to the function's prototype.

(True/False)
4.7/5
(36)

A function __________ contains the statements that make up the function.

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.8/5
(43)

Which of the following causes a function to execute?

(Multiple Choice)
4.8/5
(37)

A function can have no parameters, one parameter, or many parameters and can return __________ value(s).

(Multiple Choice)
4.8/5
(37)
Showing 41 - 49 of 49
close modal

Filters

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