Thursday, July 9, 2009

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

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





All of these three constructors are meant to initialize their respective objects. Incase of copy constructor, you are required to assign a separate space for the data members of the new object while copying the values of previously existed object.





Declare three objects (1 for each type of constructor) in main.





Write a function in class Account to display the initialized data members for each object.





Also write destructor for the class Account. Display a message that says “destructor called” in the destructor body.

Write a C++ program in which you are required to define ..?
Show us what you have so far.


No comments:

Post a Comment