?? urrentaccnt.cpp
字號(hào):
// urrentAccnt.cpp: implementation of the CurrentAccnt class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ATM.h"
#include "urrentAccnt.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CurrentAcnt *CurrentAcnt::pFirstC=NULL; //鏈表為空
CurrentAcnt::CurrentAcnt(CString accNo, CString paswrd)
:Account(accNo,paswrd,false,false)
{
if(pFirstC==NULL)
pFirstC=this; //空鏈表中建立一新帳戶
else
{
CurrentAcnt *ps=pFirstC;
for (;ps->pNextC;ps=ps->pNextC);
ps->pNextC=this; //在最后插入本節(jié)點(diǎn)
}
pNextC=NULL;
}
CurrentAcnt * CurrentAcnt::searchAccount(CString paswd)
{
CurrentAcnt *pc=pFirstC;
if(pc==NULL)
{
return NULL;
}
for (;pc;pc=pc->pNextC)
{
if ((pc->checkPassword(paswd)))
{
return pc;
}
}
return NULL;
}
CurrentAcnt *CurrentAcnt::searchtranAccount(CString accountno)
{
CurrentAcnt *pc=pFirstC;
if(pc==NULL)
{
return NULL;
}
for (;pc;pc=pc->pNextC)
{
if ((pc->GetacntNo()==accountno))
{
return pc;
}
}
return NULL;
}
double CurrentAcnt::AcntBalan()
{
return balance;
}
void CurrentAcnt::loadFile(ostream & out)
{
Account::loadFile(out);
}
bool CurrentAcnt::storageC()
{
ofstream out("活期帳戶.txt");
if(pFirstC==NULL)
return 1;
CurrentAcnt *pc=pFirstC;
for (;pc;pc=pc->pNextC)
{
out << *pc ;
}
out.close();
return true;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -