Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include"stack.h"
- using namespace std;
- int main(void)
- {
- Stack sys;
- customer db;
- int total=0,select,cnt=0;
- cout<<"========================하늘소프트 결제정보시스템 V1.2========================"<<endl;
- while(1)
- {
- cout<<"1.결제예정리스트 || 2.결제예정추가 || 3.결제예정삭제 ||4.결제하기|| 4.그냥종료"<<endl;
- cout<<"Select>";
- cin>>select;
- if(select==5) break;
- switch(select)
- {
- case 1:
- if(sys.isempty())
- {
- cout<<"DB가 비었습니다."<<endl;
- cout<<"결제정보를 추가해주세요."<<endl;
- }
- else
- sys.list();
- break;
- case 2:
- if(sys.isfull())
- {
- cout<<"DB가 꽉찾어요."<<endl;
- cout<<"필요없는 결제정보를 삭제해주세요."<<endl;
- }
- else
- {
- cout<<"고객이름와 결제금액을 입력해주세요."<<endl<<"Input>";
- cin>>db.fullname>>db.payment;
- if(sys.push(db)==0)
- cout<<"에러가 발생하여 입력이 실패했습니다."<<endl;
- else
- cout<<"정상적으로 처리되었습니다."<<endl;
- }
- break;
- case 3:
- if(sys.isempty())
- {
- cout<<"DB가 비었습니다."<<endl;
- cout<<"결제정보를 추가해주세요."<<endl;
- }
- else
- {
- char input[35];
- cout<<"삭제할 고객이름을 입력해주세요."<<endl<<"Input>";
- cin>>input;
- sys.stack_del(input);
- }
- break;
- case 4:
- total+=sys.payment();
- cout<<"정상적으로 처리되었습니다."<<endl;
- break;
- default:
- cout<<"번호가 잘못입력했어요"<<endl;
- break;
- }
- cout<<endl;
- }
- cout<<"총 수입 : "<<total<<endl;
- cout<<"프로그램 종료" <<endl;
- }
Add Comment
Please, Sign In to add comment