creditCard.cpp
资源名称:ATM.rar [点击查看]
上传用户:szmwdq
上传日期:2022-07-16
资源大小:528k
文件大小:1k
源码类别:
金融证券系统
开发平台:
Visual C++
- // creditCard.cpp: implementation of the creditCard class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "creditCard.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- creditCard::creditCard(double minB,string n,int c,float b,string ba) :BankCard(n,c,b,ba)
- {minBalance=minB;}
- void creditCard::display()
- {
- cout<<"信用卡用户"<<endl;
- cout<<"卡号:"<<getNum()<<endl;
- cout<<"帐户余额:"<<getBalance()<<endl;
- cout<<"所属银行:"<<getBank()<<endl;
- cout<<"可透支金额:"<<minBalance<<endl;
- }
- void creditCard::withdrawal(double a)
- {
- double b=getBalance();
- if(b+minBalance<a)
- cout<<"余额不足!"<<endl;
- else
- b-=a;
- setBalance(b);
- }
- creditCard::~creditCard()
- {
- }