Exam 10: Defining Classes

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

A member function that allow the user of the class to change the value in a data member is known as

Free
(Multiple Choice)
4.8/5
(44)
Correct Answer:
Verified

A

Different class may not have member functions with the same name.

Free
(True/False)
4.7/5
(37)
Correct Answer:
Verified

False

A derived class has access to

Free
(Multiple Choice)
5.0/5
(35)
Correct Answer:
Verified

B

A class member function may be private.

(True/False)
4.8/5
(35)

A member function that allows the user of the class to change the value of a private data type is called a ____________________.

(Short Answer)
4.9/5
(38)

C++11 allows you to directly set the member variables to initial values in the definition of the class. This feature is called __________________.

(Short Answer)
4.9/5
(32)

A structure definition ends with the closing brace and a _________.

(Short Answer)
5.0/5
(36)

In a struct, all members are ____________ by default

(Multiple Choice)
4.7/5
(49)

You specify an individual member of a struct by using

(Multiple Choice)
4.9/5
(27)

given the following class definition, how could you use the constructor to assign values to an object of this class? Class CDAccount { Public: CDAccount); CDAccountfloat interest, float newBalance); Float getBalance); Float getRate); Void setRatefloat interest); Void setBalancefloat newBalance); Private: Float balance, rate; }; And the following object declaration CDAccount myAccount;

(Multiple Choice)
5.0/5
(44)

Which part of the ADT tells the programmer using it how to use it?

(Multiple Choice)
4.8/5
(34)

Given the following strucure definition, what is the correct way to initialize a variable called today? Struct DateType { Int day; Int month; Int year; }

(Multiple Choice)
4.8/5
(45)

What can a constructor return? _______________

(Short Answer)
4.8/5
(37)

Given the following class, what would be the best declaration for a constructor that would allow the user to initialize the object with an initial age and cost? Class Wine { Public: Wine); Int getAge); Float getCost); Private: Int age; Float cost; }

(Multiple Choice)
4.9/5
(31)

Member functions of a class

(Multiple Choice)
4.9/5
(30)

The name of a constructor is _____________

(Short Answer)
4.8/5
(42)

A member function that gets called automatically when an object of the class is declared is called a _______________.

(Short Answer)
4.7/5
(39)

Class data members are almost always public.

(True/False)
4.9/5
(47)

To assign values to a structure variable, you use the

(Multiple Choice)
4.9/5
(42)

What is wrong with the following structure definition? Struct MyStruct { Int size; Float weight; }

(Multiple Choice)
4.8/5
(34)
Showing 1 - 20 of 61
close modal

Filters

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