Question
Question 14 (1 point) Data members or member functions of a class that are declared to be private may Question 14 options: only be accessed
Question 14 (1 point)
Data members or member functions of a class that are declared to be private may
Question 14 options:
only be accessed by the main program | |
only be accessed by members of the class | |
not be accessed by the class | |
are considered to be global variables |
Save
Question 15 (1 point)
When defining a class, the class should be composed of the kind of values a variable of the class can contain, and
Question 15 options:
member functions for that class | |
the keyword private | |
other class definitions | |
nothing else |
Save
Question 16 (1 point)
A class member function may be private.
Question 16 options:
True | |
False |
Save
Question 17 (1 point)
given the following class definition, how could you use the constructor to assign values to an object of this class? class CDAccount { public: CDAccount(); CDAccount(float interest, float newBalance); float getBalance(); float getRate(); void setRate(float interest); void setBalance(float newBalance); private: float balance, rate; }; and the following object declaration CDAccount myAccount;
Question 17 options:
myAccount = CDAccount(float myRate, float myBalance); | |
myAccount = CDAccount {myRate, myBalance}; | |
myAccount = CDAccount[myRate, myBalance]; | |
myAccount = CDAccount(myRate, myBalance); |
Save
Question 18 (1 point)
A member function of a class should be made private
Question 18 options:
always | |
only if it will never be used | |
if it will only be used by other members of the class | |
never, it is illegal to make a member function private. |
Save
Question 19 (1 point)
Which of the following function declarations will accept either cout or a file stream object as its argument?
Question 19 options:
void output( fstream &outFile); | |
void output( ofstream &outFile); | |
void output( ostream &outFile); | |
void output( iostream &outFile); |
Save
Question 20 (1 point)
It is possible to have multiple private labels in a class definition.
Question 20 options:
True | |
False |
Save
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started