欢迎来到天天文库
浏览记录
ID:57046650
大小:61.00 KB
页数:9页
时间:2020-07-31
《c++商品订购系统.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#include#include#include#include#includeusingnamespacestd;voidfile_1();voidfile_2();intmenu1();voidmenu2();voidchoose(int);voidch1();voidch2();voidch3();voidch4();voidch5();voidch6();classgoods{public:goods(void);good
2、s(string,string,float,string,float,string,float=0);~goods(void);voiddisplay1();voiddisplay2();stringgetnumber();stringgetname();floatgetprice();floatgetstore();stringgetunit2();floatgetsold();staticvoidtotalcount(float);staticfloatgettotal();voidplus_reduce(fl
3、oat);private:stringnumber;stringname;floatprice;stringunit1;floatstore;stringunit2;floatsold;staticfloattotal;};intmain()//主函数{file_1();//进入主界面,并判断密码正确与否menu2();//进入购物界面return0;}goods::goods(void){}goods::~goods(void){}goods::goods(stringnu,stringna,floatp,str
4、ingu1,floats,stringu2,floatso):number(nu),name(na),price(p),unit1(u1),store(s),unit2(u2),sold(so){}voidgoods::display1(){cout<5、w(10)<6、etsold(){returnsold;}voidgoods::plus_reduce(floatm){sold+=m;store-=m;}floatgoods::gettotal(){returntotal;}floatgoods::total=0;voidgoods::totalcount(floatn)//计算清单总价{total+=n;}boollap=0;constintN=23;goodsgood[N];//建立商品对象数组用于储存商品信息voidline(){cout<<"tt7、---------8、------9、"<0)//判断物品是否已购,若已购则输出{good[i].display2();}}cout<<"总计:"<10、stem("pause");//暂停system("cls");//清屏menu2();//返回购物菜单}void_exit()//退出{cout<<"即将退出系统!";exit(0);//退出}voidfile_1()//从goods.txt中读取商品信息{fstreamfile1("goods.txt");//打开goods.txtstringnumbe
5、w(10)<6、etsold(){returnsold;}voidgoods::plus_reduce(floatm){sold+=m;store-=m;}floatgoods::gettotal(){returntotal;}floatgoods::total=0;voidgoods::totalcount(floatn)//计算清单总价{total+=n;}boollap=0;constintN=23;goodsgood[N];//建立商品对象数组用于储存商品信息voidline(){cout<<"tt7、---------8、------9、"<0)//判断物品是否已购,若已购则输出{good[i].display2();}}cout<<"总计:"<10、stem("pause");//暂停system("cls");//清屏menu2();//返回购物菜单}void_exit()//退出{cout<<"即将退出系统!";exit(0);//退出}voidfile_1()//从goods.txt中读取商品信息{fstreamfile1("goods.txt");//打开goods.txtstringnumbe
6、etsold(){returnsold;}voidgoods::plus_reduce(floatm){sold+=m;store-=m;}floatgoods::gettotal(){returntotal;}floatgoods::total=0;voidgoods::totalcount(floatn)//计算清单总价{total+=n;}boollap=0;constintN=23;goodsgood[N];//建立商品对象数组用于储存商品信息voidline(){cout<<"tt
7、---------
8、------
9、"<0)//判断物品是否已购,若已购则输出{good[i].display2();}}cout<<"总计:"<10、stem("pause");//暂停system("cls");//清屏menu2();//返回购物菜单}void_exit()//退出{cout<<"即将退出系统!";exit(0);//退出}voidfile_1()//从goods.txt中读取商品信息{fstreamfile1("goods.txt");//打开goods.txtstringnumbe
10、stem("pause");//暂停system("cls");//清屏menu2();//返回购物菜单}void_exit()//退出{cout<<"即将退出系统!";exit(0);//退出}voidfile_1()//从goods.txt中读取商品信息{fstreamfile1("goods.txt");//打开goods.txtstringnumbe
此文档下载收益归作者所有