实用文档 float oprice; char gys[20]; public: int id; int getId() char *getName() int getCount() float getBuy() float getSale() }; 商品类的设计 class Commodity { private: spData t[50]; char *getGys() void setId(int n) void setName(char na[]) void setCount(int c) void setBuy(float i) void setSale(float o) void setGys(char g[]) int n; public: int id; int n; char name[50]; void newFile() { 文案大全
实用文档 int count; float iprice; float oprice; char gys[20]; if(n<0) n=0; int i; spData temp; for(;;n++) { cout<<\商品编号:\cin>>id; if(id==-1) break; t[n].setId(id); cout<<\商品名:\cin>>name; t[n].setName(name); cout<<\库存量:\cin>>count; t[n].setCount(count); cout<<\进价:\cin>>iprice; t[n].setBuy(iprice); cout<<\售价:\cin>>oprice; 文案大全
实用文档 t[n].setSale(oprice); cout<<\供应商:\cin>>gys; t[n].setGys(gys); cout<<\若商品添加完毕,请按-1退出添加!\ } void showData(int i) { } void showData() { int n; spData t,*p; p=&t; cout<
实用文档 } cout<<\商品编号\ <
cout<<\return ; \供应商\ \ fout< 实用文档 } fout.close(); void xiugai() { int count; char name[100]; cout<<\售价:\ cout<<\进价:\cin>>iprice; t[temp].setBuy(iprice); cout<<\库存量:\cin>>count; t[temp].setCount(count); float iprice; float oprice; char gys[20]; int temp; temp=search(); if(temp==-1) { } else{ cout<<\请输入新数据:\ cout<<\商品名:\cin>>name; t[temp].setName(name); cout<<\return; 文案大全