COSC 1436 C++ Chapter 6 Quiz with
Correct Answers
A function ________ eliminates the need to place a function definition before all calls to the function. -
ANSWER✔✔-prototype
Look at the following function prototype.
int myFunction(double);int myFunction(double);
What is the data type of the function's return value? - ANSWER✔✔-double
A function's return data type must be the same as the function's parameter(s). - ANSWER✔✔-False
If a function is called more than once in a program, the values stored in the function's local variables do
not ________ between function calls. - ANSWER✔✔-persist
Look at the following function prototype.
int myFunction(double, double, double); int myFunction(double, double, double);
How many parameter variables does this function have? - ANSWER✔✔-3
Local variables are initialized to zero by default. - ANSWER✔✔-False
Copyright © Stuvia International BV 2010-2024 Page 1/5
, Copyright © KAYLIN 2024/2025 ACADEMIC YEAR. ALL RIGHTS RESERVED FIRST PUBLISH NOVEMBER, 2024
This is a statement that causes a function to execute. - ANSWER✔✔-function call
A(n) ________ is information that is passed to a function, and a(n) ________ is information that is
received by a function. - ANSWER✔✔-argument, parameter
A function is executed when it is: - ANSWER✔✔-called
Given the following function definition:
What is the output of the following code fragment that invokes calc? - ANSWER✔✔-1 6 3
A static variable that is defined within a function is initialized only once, the first time the function is
called. - ANSWER✔✔-True
Look at the following function prototype.
int myFunction(double);int myFunction(double);
What is the data type of the function's parameter variable? - ANSWER✔✔-double
- ANSWER✔✔-10
When a function is called, flow of control moves to the function's prototype. - ANSWER✔✔-False
This statement causes a function to end. - ANSWER✔✔-return
Copyright © Stuvia International BV 2010-2024 Page 2/5