Budget5
 All Classes Files Functions Variables Typedefs
Account Class Reference

an abstract bank account. More...

Inheritance diagram for Account:
Checking Savings

Public Member Functions

 Account (unsigned accNo)
 Account constructor. More...
 
int accountNo ()
 accountNo - return the account number More...
 
double acntBalance ()
 acntBalance - return the account balance More...
 
void deposit (double amount)
 deposit - deposit an amount to the account More...
 
virtual bool withdrawal (double amount)
 withdrawal - withdraw an amount from the account More...
 
void display ()
 display - display the current object on the standard out More...
 
virtual const char * type ()
 type - return an indication of what type of Account the current object is More...
 

Static Public Member Functions

static int noAccounts ()
 noAccounts - return the number of accounts More...
 

Protected Attributes

unsigned accountNumber
 
double balance
 

Static Protected Attributes

static int count = 0
 

Detailed Description

an abstract bank account.

This abstract class incorporates propertiescommon to both account types: Checking and Savings. However, it's missing the concept withdrawal(), which is different between the two

Constructor & Destructor Documentation

Account::Account ( unsigned  accNo)
inline

Account constructor.

Parameters
accNo- the account number to use

Member Function Documentation

int Account::accountNo ( )
inline

accountNo - return the account number

Returns
int
double Account::acntBalance ( )
inline

acntBalance - return the account balance

Returns
double
void Account::deposit ( double  amount)
inline

deposit - deposit an amount to the account

void Account::display ( )
inline

display - display the current object on the standard out

static int Account::noAccounts ( )
inlinestatic

noAccounts - return the number of accounts

Returns
int
virtual const char* Account::type ( )
inlinevirtual

type - return an indication of what type of Account the current object is

Returns
a string containing the name of the class

Reimplemented in Savings, and Checking.

virtual bool Account::withdrawal ( double  amount)
inlinevirtual

withdrawal - withdraw an amount from the account

The function first checks to make sure that sufficient funds are available. If not, the function outputs an error message and returns a false.

Returns
true if the function executed properly

Reimplemented in Savings, and Checking.

Member Data Documentation

unsigned Account::accountNumber
protected

the number of the current account

double Account::balance
protected

the balance in current account

int Account::count = 0
staticprotected

the number of account objects


The documentation for this class was generated from the following file: