Exam 7: Using Classes

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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

(Multiple Choice)
4.9/5
(45)

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

(Short Answer)
4.9/5
(35)

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

(Multiple Choice)
4.9/5
(40)

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

(Short Answer)
4.9/5
(39)

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

(Essay)
4.8/5
(31)

To ____ components is to contain them.

(Multiple Choice)
4.7/5
(27)

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

(Multiple Choice)
4.9/5
(41)

The scope resolution operator is ____.

(Multiple Choice)
4.8/5
(36)

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.

(Multiple Choice)
4.9/5
(36)

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

(True/False)
4.8/5
(35)

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

(Essay)
4.8/5
(30)
Match each term with the correct statement below.
Premises:
contains the functions of a class
Responses:
class variable
this pointer
pointer-to-member operator
Correct Answer:
Verified
Premises:
Responses:
contains the functions of a class
class variable
(Matching)
4.8/5
(36)

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.

(Essay)
4.9/5
(37)

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.

(Essay)
4.8/5
(40)

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

(Multiple Choice)
4.9/5
(29)

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

(Multiple Choice)
4.9/5
(36)
Showing 41 - 56 of 56
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)