diff --git a/account.cpp b/account.cpp index 5fd2a26..b4db4ca 100644 --- a/account.cpp +++ b/account.cpp @@ -1,6 +1,4 @@ #include -#include -#include using namespace std; @@ -10,4 +8,17 @@ Account::Account ( double initial_balance ) : balance(initial_balance) { } Account::~Account () { + cout << "account deleted" << endl; +} + +double Account::getBalance() const { + return balance; +} + +void Account::deposit(double amount) { + balance += amount; +} + +void Account::withdraw(double amount) { + balance -= amount; } diff --git a/account.h b/account.h index 2fb093f..011960a 100644 --- a/account.h +++ b/account.h @@ -17,8 +17,14 @@ class Account /* ==================== ACCESSORS ======================================= */ + // current balance of the Account + double getBalance() const; + /* ==================== MUTATORS ======================================= */ + void deposit(double amount); + void withdraw(double amount); + /* ==================== OPERATORS ======================================= */ Account& operator = ( const Account &other ); /* assignment operator */