Filters
Question type

Study Flashcards

When may it be a good idea to make data public in a class?

Correct Answer

verifed

verified

You can choose to make data public if yo...

View Answer

The scope resolution operator is ____.


A) &
B) ::
C) *
D) ->

Correct Answer

verifed

verified

A function that is a user of your class is a class ____________________.

Correct Answer

verifed

verified

Conventionally, object names begin with a(n) ____________________ letter.

Correct Answer

verifed

verified

Match each term with the correct statement below.

Premises
contains the functions of a class
Responses
class variable
this pointer
pointer-to-member operator
class
polymorphism
interface
abstract data type
access modifier
implementation section

Correct Answer

class variable
this pointer
pointer-to-member operator
class
polymorphism
interface
abstract data type
access modifier
implementation section

The ____ section of a class contains the class name, variables (attributes) , and function prototypes.


A) header
B) definition
C) declaration
D) implementation

Correct Answer

verifed

verified

The access modifier ____ means a class member cannot be accessed using any statements in any functions that are not also part of the class.


A) public
B) private
C) protected
D) static

Correct Answer

verifed

verified

When a class field is ____, only one memory location is allocated, no matter how many objects of the class you instantiate.


A) const
B) static
C) void
D) private

Correct Answer

verifed

verified

Write a class declaration that has three private fields and three functions that can be used to assign values to each of the data fields of the class. Write the implementation of one of the functions.

Correct Answer

verifed

verified

class Student
{
private:
int idNum;
...

View Answer

Consider the following class: class Student { private: int idNum; string lastName; double gradePointAverage; }; Add a public function void displayStudentData() to the class definition and then write an implementation for the function.

Correct Answer

verifed

verified

class Student
{
private:
in...

View Answer

____ variables are sometimes called class variables, class fields, or class-wide fields.


A) Public
B) Private
C) Constant
D) Static

Correct Answer

verifed

verified

To ____ components is to contain them.


A) instantiate
B) abstract
C) declare
D) encapsulate

Correct Answer

verifed

verified

When you do not want to declare an object, you can still access a static , class-wide field by using a function that is ____.


A) static
B) const
C) public
D) private

Correct Answer

verifed

verified

You must use both the class name and the ____ operator when you implement a member function, because they tie the function to the class and allow every instantiated object to use the function name.


A) address
B) dot
C) scope resolution
D) pointer-to-member

Correct Answer

verifed

verified

The ______________________________ is constructed by using a dash followed by a right-angle bracket (or greater-than sign).

Correct Answer

verifed

verified

pointer-to...

View Answer

When you create a class, you usually make data items public.

Correct Answer

verifed

verified

Showing 41 - 56 of 56

Related Exams

Show Answer