⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urrentaccnt.cpp

📁 一个模仿ATM提款机的MFC程序
💻 CPP
字号:
// 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;					//在最后插入本节点

	}
	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;
				
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -