Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include "Product.h"
- using namespace std;
- int main(void)
- {
- Product sys;
- int select,tmp1,tmp2;
- while(1)
- {
- cout<<"||1)제품정보추가|2)제품정보삭제|3)제품리스트|4)제품비교|5)프로그램종료||"<<endl;
- cout<<"Select>"; cin>>select;
- if(select==5) break;
- switch(select){
- case 1:
- char stuff[100];
- cout<<"제품이름,가격,평점을 입력해주세요."<<endl;
- cout<<"Input>"; cin>>stuff>>tmp1>>tmp2;
- if(sys.add(stuff,tmp1,tmp2))
- cout<<"입력이 가능한 갯수인 500개을 넘어 입력이 안되요."<<endl;
- else
- cout<<"정상적으로 처리되었습니다."<<endl;
- break;
- case 2:
- cout<<"삭제할 제품의 번호를 입력하세요."<<endl;
- cout<<"Input>"; cin>>tmp1;
- sys.del(tmp1); break;
- case 3:
- sys.print(); break;
- case 4:
- cout<<"비교할 두제품의 번호를 입력해주세요."<<endl;
- cout<<"Stuff1_Input>"; cin>>tmp1;
- cout<<"Stuff2_Input>"; cin>>tmp2;
- cout<<tmp1<<"번 제품정보"<<endl;
- sys.getInfo(tmp1);
- cout<<tmp2<<"번 제품정보"<<endl;
- sys.getInfo(tmp2);
- sys.compare(tmp1,tmp2); break;
- default:
- cout<<"잘못된 선택번호입니다.를 다시 입력해주세요."<<endl;
- break;
- }
- cout<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment