Filters
Question type

Study Flashcards

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


A) 6.0
B) 7.0
C) 8.0
D) 9.0

Correct Answer

verifed

verified

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


A) formal parameter
B) actual parameter
C) data type
D) type of the function

Correct Answer

verifed

verified

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


A) cout << testAlpha(5, 'A', 2) ;
B) cout << testAlpha( int 5, char 'A', int 2) ;
C) cout << testAlpha('5.0', 'A', '2.0') ;
D) cout << testAlpha(5.0, "65", 2.0) ;

Correct Answer

verifed

verified

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


A) cout << test(12, &) ;
B) cout << test("12.0", '&') ;
C) int u = test(5.0, '*') ;
D) cout << test('12', '&') ;

Correct Answer

verifed

verified

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


A) '$'
B) '0'
C) '1'
D) An error, because you cannot use tolower with '$'.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

The heading of the function is also called the ____.


A) title
B) function signature
C) function head
D) function header

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

True

____________________ 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

Correct Answer

verifed

verified

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.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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 ____.


A) 65
B) 67
C) 96
D) 98

Correct Answer

verifed

verified

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


A) 11.0
B) 12.0
C) 13.0
D) 14.0

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

reference

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


A) <cctype>
B) <iostream>
C) <cmath>
D) <cstdlib>

Correct Answer

verifed

verified

Which of the following function prototypes is valid?


A) int funcExp(int x, float v) ;
B) funcExp(int x, float v) {};
C) funcExp(void) ;
D) int funcExp(x) ;

Correct Answer

verifed

verified

A

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


A) zero
B) null
C) void
D) empty

Correct Answer

verifed

verified

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


A) 2
B) 3
C) 6
D) 7

Correct Answer

verifed

verified

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


A) cin >> myFunc(y) ;
B) cout << myFunc(myFunc(7, 8) , 15) ;
C) cin >> myFunc('2', '3') ;
D) cout << myFunc(myFunc(7) , 15) ;

Correct Answer

verifed

verified

Showing 1 - 20 of 41

Related Exams

Show Answer