Type, name

Question: When each object of a class maintains its own copy of an attribute, the

variable that represents the attribute is also known as a(n) _________.

Data member

Question: Keyword public is a(n) _________.

Access specifier

Question: Return type _________ indicates that a function will perform a task but will

not return any information when it completes its task

Void

Question: Function _________ from the <string> library reads characters until a newline

character is encountered, then copies those characters into the specified string

Getline

Question: When a member function is defined outside the class definition, the function

header must include the class name and the _________, followed by the function name to

"tie" the member function to the class definition

Binary scope resolution operator (::)

Question: The source-code file and any other files that use a class can include the class's

header file via an _________ preprocessor directive

#include

Question: By convention, function names begin with a capital letter and all subsequent

words in the name begin with a capital letter

False

Question: Empty parentheses following a function name in a function prototype indicate

that the function does not require any parameters to perform its task

True

Question: Data members or member functions declared with access specifier private are

accessible to member functions of the class in which they are declared

True

Question: Variables declared in the body of a particular member function are known as

data members and can be used in all member functions of the class

False

Question: Every function's body is delimited by left and right braces ({ and }).

True

Question: Any source-code file that contains int main() can be used to execute a program

True

Question: The types of arguments in a function call must match the types of the

corresponding parameters in the function prototype's parameter list

True

Question: What is the difference between a local variable and a data member?

A local variable is declared in the body of a function and can be used only from the point

At which it is declared to the immediately following closing brace. A data member is

Declared in a class definition, but not in the body of any of the class's member functions.

Every object (instance) of a class has a separate copy of the class's data members. Also,

Data members are accessible to all member functions of the class.

Question: Explain the purpose of a function parameter. What is the difference between a

parameter and an argument?


Понравилась статья? Добавь ее в закладку (CTRL+D) и не забудь поделиться с друзьями:  



double arrow
Сейчас читают про: