Exam 6: User-Defined Function

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

In C++, a function prototype is the function heading without the body of the function.

Free
(True/False)
4.9/5
(83)
Correct Answer:
Verified

True

Which of the following function prototypes is valid?

Free
(Multiple Choice)
4.8/5
(77)
Correct Answer:
Verified

A

Stream variables (for example, ifstream and ofstream) should be passed by ____________________ to a function.

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

reference

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.8/5
(81)

Functions that do not have a return type are called ____ functions.

(Multiple Choice)
4.7/5
(86)

The statement: return 2 * 3 + 1, 1 + 5; returns the value ____.

(Multiple Choice)
4.9/5
(77)

The output of the statement:cout << pow(2.0, pow(3.0, 1.0)) << endl; is ____.

(Multiple Choice)
4.7/5
(95)

Using functions greatly enhances a program's readability because it reduces the complexity of the function main.

(True/False)
4.8/5
(81)

To use the predefined function tolower, the program must include the header file ____.

(Multiple Choice)
4.8/5
(73)

Given the following function prototype:​ int myFunc(int, int); ​ Which of the following statements is valid? Assume that all variables are properly declared.

(Multiple Choice)
4.8/5
(72)

Assume that all variables are properly declared.The following statement in a value-returning function is legal. Assume that all variables are properly declared.The following statement in a value-returning function is legal.

(True/False)
4.7/5
(76)

Given the function prototype:​ double testAlpha(int u, char v, double t); ​ Which of the following statements is legal?

(Multiple Choice)
4.9/5
(74)

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.7/5
(82)

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

(Multiple Choice)
4.8/5
(89)

____________________ parameters are useful in three situations:• When the value of the actual parameter needs to be changed • When you want to return more than one value from a function • When passing the address would save memory space and time relative to copying a large amount of data

(Short Answer)
4.9/5
(84)

The heading of the function is also called the ____.

(Multiple Choice)
4.7/5
(64)

The ____________________ of a function consists of the function name and its formal parameter list.

(Short Answer)
4.8/5
(70)

A variable or expression listed in a call to a function is called the ____.

(Multiple Choice)
5.0/5
(86)

The output of the statement: cout << pow(3.0, 2.0) + 5 << endl; is ____.

(Multiple Choice)
4.8/5
(82)

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

(Multiple Choice)
4.8/5
(82)
Showing 1 - 20 of 41
close modal

Filters

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