Solved

Given the Following Class Definition, How Could You Use the Constructor

Question 10

Multiple Choice

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;


A) myAccount = CDAccountfloat myRate, float myBalance) ;
B) myAccount = CDAccount {myRate, myBalance};
C) myAccount = CDAccount[myRate, myBalance];
D) myAccount = CDAccountmyRate, myBalance) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions