Chapter 6 - C++

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

driver

A ________ is a program module whose purpose is to test other modules by calling them.

local

A ________ variable is defined inside the body of a function and is not accessible outside that function.

definition

A function ________ includes the statements that make up the function. That is, it includes the body of the function which appears within braces.

either 0 or 1

A function can have zero to many parameters, and it can have ________ return value(s) in the return statement.

whenever it is called

A function other than the main function is executed ________.

returns no value at all of any type

A void function is one that ________.

modular

Breaking a program up into a set of manageable sized functions is called ________ programming.

call

Functions are ideal for use in menu-drive programs. When a user selects a menu item, the program can ________ an appropriate function to carry out the user's choice.

an identifier name or constant for each argument which does not have a default.

In a function call, in addition to the name of the function, you are required to furnish ________.

d) All of the above

In a function header, in addition to the name of the function, you are required to furnish ________. (Hint: consider the difference between a function prototype and a function header. They are not the same.) a) a data type for each parameter b) the data type of the return value c) an identifier name for each parameter d) All of the above e) B and C, but not A.

e) A and C, but not B.

In a function prototype, in addition to the name of the function, you are required to furnish ________. a) the data type of the return value b) an identifier name for each parameter c) a data type for each parameter d) All of the above e) A and C, but not B.

exit ( )

The ________ function causes the entire program to terminate, regardless of which function or control mechanism is executing.

return

The ________ statement causes a function to end and the flow of control to move back to the point where the function call was made.

static

The value in a ________ local variable is retained between function calls. This can be used to count how many times a function is called, among other things.

False

True/False: If the closing brace of a function body is reached, the flow of control moves to the next function in the file. That is, the flow of control drops down into the code after the closing brace.

True

True/False: It is possible for a function to have some parameters with default arguments and some without.

their parameter lists are different

Two or more functions may have the same name provided that ________.

by value

When a function only needs a copy of an argument passed to it, the argument should normally be passed ________.

overloaded

When more than one function has the same name they are called ________ functions.

reference

When used as a parameter, a ________ variable allows a function to access and modify the original argument passed to it. These kind of variables indicate a call-by-reference.


Set pelajaran terkait

Pressure-Volume Loops of the Left Ventricle

View Set

History 50 Multiple Choice Questions

View Set

Algebra 2: 7.05 Quiz: Coterminal Angles

View Set

College Math Unit 3 Lesson 1 Review

View Set