Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <string>
- #include "account.h"
- using namespace std;
- int main(void)
- {
- char name[40];
- int money;
- cout<<"생성할 이름와 초기입금할 금액을 입력해주세요."<<endl;
- cin>>name>>money;
- BankAccount bank(name,"1234-1234",money);
- cout<<"계죄가 생성되었습니다. 계좌정보는 아래와 같습니다."<<endl;
- bank.show();
- while(1)
- {
- int temp;
- cout<<"하늘은행 ATM"<<endl;
- cout<<"||1. 계좌정보 || 2.입금 || 3.출금 || 4. 종료||"<<endl;
- cin>>temp;
- if(temp>3) break;
- else
- {
- switch(temp)
- {
- case 1:bank.show(); break;
- case 2:cout<<"입금하실 금액을 입력하세요."<<endl; cin>>temp; bank.deposit(temp); break;
- case 3:cout<<"출금하실 금액을 입력하세요."<<endl; cin>>temp; bank.withdraw(temp); break;
- }
- }
- }
- cout<<endl<<"하늘은행 ATM 종료!"<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment