account.cpp

来自「用模板制作的银行类」· C++ 代码 · 共 28 行

CPP
28
字号
#include<iostream.h>
#include "Account.h"

int Account::count=0;              //帐户个数为0

Account::Account(unsigned accNo, double bal)
{
  acntNumber=accNo;
  balance=bal;
  count++;
}

void Account::Display()//显示
{ 
	cout<<"账 户 号:"<<acntNumber<<" | "<<"余 额: "<<balance<<" | "<<endl; 
}

void Account::Deposit(double amount)//存款
{ 
	balance+=amount;  
	Display(); 
}

unsigned Account::AccountNo() { return acntNumber; }

double Account::GetBalance() { return balance; }

int& Account::NoAccounts() { return count; }

⌨️ 快捷键说明

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