Exam 6: User-Defined Functions

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

The ____________________ of an identifier refers to where in the program an identifier is accessible (visible).

Free
(Short Answer)
4.9/5
(42)
Correct Answer:
Verified

scope

The output of the statement: cout << tolower('$') << endl; Is ____.

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

A

Which of the following function prototypes is valid?

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

A

Once you write and properly debug a function, you can use it in the program (or different programs) again and again without having to rewrite the same code repeatedly.

(True/False)
4.7/5
(38)

Assume that all variables are properly declared. The following statement in a value-returning function is legal. if (x % 2 == 0) return x; else return x + 1;

(True/False)
5.0/5
(37)

Assume the following. static_cast<int>('a') = 97 Static_cast<int>('A') = 65 The output of the statement: Cout << static_cast<int>(tolower('B')) << endl; is ____.

(Multiple Choice)
4.7/5
(37)

The data type of a variable in a return statement must match the function type.

(True/False)
4.8/5
(39)

A function prototype is ____.

(Multiple Choice)
4.9/5
(36)

Given the following function: int next(int x) { \quad Return (x + 1); } What is the output of the following statement? Cout << next(next(5)) << endl;

(Multiple Choice)
5.0/5
(33)

Given the following function prototype: double tryMe(double, double);, which of the following statements is valid? Assume that all variables are properly declared.

(Multiple Choice)
4.8/5
(31)

The program that tests a function is called a(n) ____________________ program.

(Short Answer)
4.9/5
(29)

____________________ identifiers are not accessible outside of the function (block).

(Short Answer)
4.8/5
(38)

When you attach & after the dataType in the formal parameter list of a function, the variable following that dataType becomes a(n) ____________________ parameter.

(Short Answer)
4.8/5
(35)

The following function heading in a C++ program is valid: int funcExp(int u, char v, float g)

(True/False)
4.9/5
(39)

A variable listed in a header is known as a(n) ____ parameter.

(Multiple Choice)
4.8/5
(39)

The standard header file for the abs(x)function is ____.

(Multiple Choice)
4.8/5
(40)

Given the following function prototype: int test(float, char);, which of the following statements is valid?

(Multiple Choice)
4.8/5
(42)

The execution of a return statement in a user-defined function terminates the program.

(True/False)
4.9/5
(33)

The following return statement returns the value 10. return 10, 16;

(True/False)
4.8/5
(37)

The statement: return 37, y, 2 * 3; returns the value ____.

(Multiple Choice)
4.7/5
(32)
Showing 1 - 20 of 50
close modal

Filters

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