商品管理系统项目实训报告内容摘要:

\n endl。 cout 按任意键 继续。 endl。 _getch()。 return。 } } while(p) { if(pnum == num) { cout \t 找到要删除的商品信息 endl。 pdisplay()。 cout \t 是否要删除该信息【 Y/N】【 y/n】 :。 cin ch。 if(ch== 39。 y39。 || ch == 39。 Y39。 ) { formernext = pnext。 delete p。 n。 cout \n\t*********************** endl。 cout \t*** 删除成功 ! *** endl。 cout \t***********************\n endl。 cout 按任意键继续。 endl。 _getch()。 return。 } else { cout \n\t*********************** endl。 cout \t*** 删除失败 ! *** endl。 cout \t***********************\n endl。 cout 按任意键继续。 endl。 _getch()。 return。 } } former = p。 p = pnext。 } if(!p) { cout \t 不存在该条形码的商品。 endl。 cout \t 删除失败。 endl。 cout 按任意键继续。 endl。 _getch()。 return。 } } void Supermarket::Modify() //修改商品 { if(phead == NULL) { cout \t 暂无商品信息。 endl。 cout \t 请添加商品信息 endl。 cout 按任意键继续。 endl。 _getch()。 return。 } string num。 Goods *p。 p = NULL。 cout \t 请输入要修改的商品条形码 :。 cin num。 p = SearchNum(num)。 if(p) { cout \t 查找成功 ! endl。 cout \t**************************************** endl。 cout \t** 请输入该条形码商品的新信息 ** endl。 cout \t**************************************** endl。 cout \t 商品进价 :。 cinppricein。 cout \t 商品售价 :。 cinppriceout。 cout \t 商品库存数量 :。 cinpcount。 cout \n\t*********************** endl。 cout \t*** 修改成功 ! *** endl。 cout \t***********************\n endl。 cout 按任意键继续。 endl。 _getch()。 } else { cout \n\t********************************* endl。 cout \t*** 不存在该条形码的商品 ! *** endl。 cout \t*** 修改失败 ! *** endl。 cout \t*********************************\n endl。 cout 按任意键继续。 endl。 _getch()。 } } void Supermarket::Query() //显示商品 { Goods *p。 if(phead == NULL) { cout \n\t************************* endl。 cout \t*** 暂无商品信息 ! *** endl。 cout \t*** 请添加商品信息 ! *** endl。 cout \t*************************\n endl。 cout 按任意键继续。 endl。 _getch()。 return。 } cout *************************** endl。 cout ** 共有 n 种商品 ** endl。 cout *************************** endl。 cout endl。 p = phead。 while(p) { pdisplay()。 p = pnext。 } cout \n\t*********************** endl。 cout \t*** 显示成功 ! *** endl。 cout \t***********************\n endl。 cout 按任意键继续。 endl。 _getch()。 } void Supermarket::Sale() //出售商品 { string num。 int count。 Goods *p。 p = NULL。 cout \t 出售商品的条形码 :。 cinnum。 cout \t 出售商品数量 :。 cin count。 p = SearchNum(num)。 if(p) { if(pcount = count) { cout \t******************************* endl。 cout \t 该商品仓库余量 : pcount endl。 psale_count = count。 cout \t 已出售数量 : psale_count。 pcount = pcount count。 cout \t 商品剩余 : pcount endl。 psale_profit = pprofit * psale_count。 cout \t 盈利 : psale_profit 元 endl。 cout \t******************************* endl。 cout \n\t*********************** endl。 cout \t*** 交易完成 ! *** endl。 cout \t***********************\n endl。 pdisplay()。 cout 按任意键继续。 endl。 _getch()。 return。 } else { cout \n\t*********************************** endl。 cout \t*** 已找到该商品的条形码 ! *** endl。 cout \t*** 余量不足,请清点仓库库存 ! *** endl。 cout \t***********************************\n endl。 _getch()。 return。 } } else { cout \n\t*********************************** endl。 cout \t*** 系统未记录该条形码的商品 ! *** endl。 cout \t*** 出售失败 ! *** endl。 cout \t***********************************\n endl。 cout 按任意键继续。 endl。 _getch()。 return。 } } void Supermarket::Swap(Goods *p1, Goods *p2) { num = p2num。 name = p2name。 pricein = p2pricein。 priceout = p2priceout。 count = p2count。 profit = p2profit。 sale_count = p2sale_count。 sale_profit = p2sale_profit。 p2num = p1num。 p2name = p1name。 p2pricein = p1pricein。 p2priceout = p1priceout。 p2count = p1count。 p2profit = p1pro。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。