2 Replies - 696 Views - Last Post: 23 March 2008 - 04:19 PM Rate Topic: -----

#1 LSUnointep  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-February 08

where to put copy constructor

Post icon  Posted 23 March 2008 - 03:46 PM

I am in the process of making a bank account class. I need to put a copy constructor to compare the checking and savings account. Also I need to learn how to insert the checking and savings accounts. I need an assignment operator to assign the checking account to the saving. Last but not least I need a overloaded operator to find the total of the saving and checking account. Any help appreciated whether you know one thing or two


# include<iostream>
void account::withdraw(int amount)
void account::deposit(int amount)
int account::balance(void) 
 
 {
		public:
				static int transactions;

				Account();
				Account(const Account &right);// copy cstr
				~Account();
			 
		
			  void withdraw(int);//Take from account
				void deposit(int);// Put into account
				int balance()const;/ / Read the balance

				  
				Account& operator+(const Account &);
				Account& operator=(const Account &);
				virtual void account_update(int)=0;
		private:
				   int bal;
		};
ostream &operator<<(ostream &, const Account&);
 
{
cout<<"
	  1. Deposit
	  2. Withdraw
	  3. Balance
cin>>choice;
switch(choice)
{
			cout<<"
			break;
	  case 1 : obj.deposit();
			break;
	  case 2: obj.withdraw();
			break;
	  case 3 :obj.balance();
			break;
	   
 
} 
void deposit(int) 
{
cout <<" Deposit ";
cout<<" Amount being deposited ";
cin>>more;
balance+=more;
} 
 
void withdraw(int)
{
cout<<"Withdrawal ";
cout<<" Amount being withdrawed : ";
cin>>amt;
balance-=amt;
} 
 
int balance()const;
{ 
cout<< " Account Balance" 
 
cout<<" Your Balance Is" 
 
balance= totl 
}



Is This A Good Question/Topic? 0
  • +

Replies To: where to put copy constructor

#2 Mila  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 33
  • View blog
  • Posts: 193
  • Joined: 28-October 06

Re: where to put copy constructor

Posted 23 March 2008 - 04:13 PM

So what seems to be the problem? The abstract class's header file looks ok to me.
Was This Post Helpful? 0
  • +
  • -

#3 LSUnointep  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-February 08

Re: where to put copy constructor

Posted 23 March 2008 - 04:19 PM

View PostMila, on 23 Mar, 2008 - 04:13 PM, said:

So what seems to be the problem? The abstract class's header file looks ok to me.

I dont have separate checking and savings account.....what do you see in my code that i have already that i said i needed?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1