368 стр. Часть 6. Великолепная десятка
accountNumber = accNo ;
balance = 0 ;
/* Внесение в список */
pNode = new Node< Account >( pList , this ) ;
pList -> addNode( pNode ) ;
count++ ;
}
/* Функции доступа */
int accountNo( ) { return accountNumber ; }
double acntBalance( ) { return balance ; }
static int noAccounts( ) { return count ; }
static Account* first( LinkedList< Account >* pLinkedList )
{
Node< Account >* pNode = pLinkedList -> firstNode( ) ;
return pNode -> current( ) ;
}
Account* next( )
{
Node< Account >* pNextNode = pNode -> next( ) ;
return pNextNode -> current( ) ;
}
/* Функции транзакций */
void deposit( double amount ) { balance += amount ; }
virtual bool withdrawal( double amount )
{
if ( balance < amount )
{
cout << "Недостаточно денег: на счету " << balance
<< ", снимаем " << amount