?? account.h
字號:
// Account.h: interface for the Account class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ACCOUNT_H__A3F65E2D_6371_4B92_8DEA_4F8D17E7BA90__INCLUDED_)
#define AFX_ACCOUNT_H__A3F65E2D_6371_4B92_8DEA_4F8D17E7BA90__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "stdafx.h"
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
#include <iomanip.h>
#include <fstream.h>
//////////////////////////////////////////////////////////////////////////
/// Account基類的定義聲明
//////////////////////////////////////////////////////////////////////////
class Account
{
public:
Account(){balance=0;
password="";
acntNumber="";
}
Account(CString accNo,CString paswrd,bool location,bool bank); //建立一個帳戶
virtual ~Account(); //析構(gòu)帳戶
bool checkPassword(CString Password); //檢查密碼
void changePassword(CString Password); //更改密碼
CString GetacntNo(); //返回帳號
virtual void loadFile(ostream & out); //帳戶信息存盤
void reloadbalance(double); //重載總余額
double GetBalance(){return balance;
}
double GetCheckFee(double money){ //查詢費(fèi),依據(jù)屬地跟屬行
if (location&&(!bank)) {return 0.3;} //如果是本地跨行則收取3角
if ((!location)&&(!bank)) {return 4;} //如果是外地跨行則收取4元
return 0; //否則不收費(fèi)
}
double GetWithdrawFee(double money){ //取款費(fèi),依據(jù)屬地跟屬行
if (location&&(!bank)) {return 2;} //如果是本地跨行則為2元
if ((!location)&&(!bank)) {
double temp=money*0.005;
return temp<5?temp:5;
} //如果是異地跨行則收取5%,不低于5元
return 0; //否則不收費(fèi)
}
protected:
CString acntNumber; //帳號
CString password; //密碼
double balance; //總余款
bool location; //是否屬于本地
bool bank; //是否屬于本銀行
};
ostream& operator <<(ostream & out ,Account &Ac);
#endif // !defined(AFX_ACCOUNT_H__A3F65E2D_6371_4B92_8DEA_4F8D17E7BA90__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -