 |
|

Given the following classes, how can we define a BankAccount constructor that initializes the amount member variable as well as the id member variable?
class Money
{
public:
Money(int d, int c);
int dollars;
int cents;
};
Money::Money(int d, int c)
{
dollars = d;
cents = c;
}
class BankAccount
{
public:
int id;
Money amount;
BankAccount(int id, int dollars, int cents);
};
|
 |
| |
|
|
 |