To withdraw money you will need to add another method to the Account class
//Definition of the Account class
[class Account
{
public:
Account( int ); // constructor initializes balance
void credit( int ); // add an amount to the account balance
void debit( int ); // subtract an amount to the account balance
int getBalance(); // return the account balance
void withdraw(int amount);
private:
int balance; // data member that stores the balance
}; // end class Account] Last edited by Ancient Dragon; Jun 12th, 2008 at 8:18 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Online 21,950 posts
since Aug 2005