Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<string.h>
- #include "account.h"
- using namespace std;
- BankAccount::BankAccount(const char* client, const char *num, double bal)
- {
- strcpy(name,client);
- strcpy(acctnum,num);
- balance=bal;
- }
- void BankAccount::show(void) const
- {
- cout<<"-----------------------------"<<endl;
- cout<<"고객이름 : "<<name<<endl;
- cout<<"계좌번호 : "<<acctnum<<endl;
- cout<<"현재잔액 : "<<balance<<endl;
- cout<<"-----------------------------"<<endl<<endl;
- }
- void BankAccount::deposit(double cash)
- {
- balance+=cash;
- cout<<">>잔액 : "<<balance<<"<<"<<endl;
- cout<<">>정상으로 처리되었습니다<<"<<endl<<endl;
- }
- void BankAccount::withdraw(double cash)
- {
- if(balance>=cash)
- {
- balance-=cash;
- cout<<">>잔액 : "<<balance<<"<<"<<endl;
- cout<<">>정상으로 처리되었습니다<<"<<endl<<endl;
- }
- else
- {
- cout<<">>잔액 : "<<balance<<"<<"<<endl;
- cout<<">>잔액이 부족합니다.<<"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement