Thursday, July 9, 2009

Write a C++ program in which you are required to define a class named Account.?

The class must include the following two data members.





// data member for account holder’s name


1: Account_Holder





//data member for amount in the account


2: Amount





Your Program should define three constructors for the class Account





1: a constructor with no parameter


2: a constructor with two parameters (Account_Holder,Amount)


3: a copy constructor

Write a C++ program in which you are required to define a class named Account.?
class Account


{


protected:


char* Account_Holder;


int Amount;


public:


Account();


Account( char* Holder, int Num );


Account( Account %26amp;obj );


};





Account::Account()


{


Account_Holder = NULL;


Amount = 0;


}


Account::Account( char* Holder, int Num )


{


Account_Holder = Holder;


Amount = Num;


}


Account::Account( Account %26amp;obj )


{


Account_Holder = obj.Account_Holder;


Amount = obj.Amount;


}
Reply:Sorry I've already finished my homework and don't have time to do yours.





I bet if you looked it up in your book you could probably figure it out though, you have been paying attention in class haven't you?

baseball cards

No comments:

Post a Comment