Filters
Question type

Study Flashcards

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 following function: what is the output of the following statement? Cout << next(next(5) ) << endl; Given the following function: what is the output of the following statement? Cout << next(next(5) )  << endl;   A)  5 B)  6 C)  7 D)  8


A) 5
B) 6
C) 7
D) 8

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

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


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

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

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

Correct Answer

verifed

verified

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

Which of the following function prototypes is valid?


A) int funcTest(int x, int y, float z) {}
B) funcTest(int x, int y, float) {};
C) int funcTest(int, int y, float z)
D) int funcTest(int, int, float) ;

Correct Answer

verifed

verified

Given the following function: what is the output of the following statement? Cout << strange(4, 5) << endl; Given the following function: what is the output of the following statement? Cout << strange(4, 5)  << endl;   A)  -1 B)  1 C)  9 D)  20


A) -1
B) 1
C) 9
D) 20

Correct Answer

verifed

verified

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

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

If the formal parameter list of a function is empty, the parentheses after the function name are not needed.

Correct Answer

verifed

verified

The function main is always compiled first, regardless of where in the program the function main is placed.

Correct Answer

verifed

verified

Which statement below about prototypes and headers is true?


A) Parameter names must be listed in the prototype, but not necessarily in the header.
B) Prototypes end with a semicolon, but headers do not.
C) Headers should come before prototypes.
D) Headers end with a semicolon, but prototypes do not.

Correct Answer

verifed

verified

A function ____________________ is a function that is not fully coded.

Correct Answer

verifed

verified

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

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


A) actual
B) local
C) formal
D) function

Correct Answer

verifed

verified

If a function needs to return more than one value, as a rule of good programming style, you should change it to a(n) ____________________ function and use the appropriate reference parameters to return the values.

Correct Answer

verifed

verified

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


A) cout << test(7, test(14, 23) ) ;
B) cout << test(test(7, 14) , 23) ;
C) cout << test(14, 23) ;
D) cout << test(7, 14, 23) ;

Correct Answer

verifed

verified

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.

Correct Answer

verifed

verified

Showing 21 - 40 of 41

Related Exams

Show Answer