欢迎来到冰豆网! | 帮助中心 分享价值,成长自我!
冰豆网
全部分类
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • 党团工作>
  • ImageVerifierCode 换一换
    首页 冰豆网 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    101006434《商品销售管理系统》.docx

    • 资源ID:8292260       资源大小:50.09KB        全文页数:24页
    • 资源格式: DOCX        下载积分:3金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    101006434《商品销售管理系统》.docx

    1、101006434商品销售管理系统数据结构课 程 设 计 报 告 书题 目: 商品销售管理 系 别: 计算机科学与应用系 学 号: 101006434 学生姓名: 指导教师: 傅尔胜 完成日期: 2012年6月7日 一、需求分析 商品销售管理 商品信息的组成部分为:商品编号、商品名称、商品单价、生产商、库存量等。销售单信息的组成部分为:商品编号、商品名称、商品单价、购买数量、该商品应付金额等。2、概要设计1、数据类(class Data)的数据类型定义:class Data /数据类private: int id; /产品编号 char name100; /产品名称 int count; /库

    2、存数量 int salecount; /已售数量 float iprice; /进价 float oprice ; /售价 char gys20; /供应商Public: /公有函数 int getid() /获取id char *getname() /获取产品名 Int getcount() /获取库存量 Int getsalecount() /获取已售量 Float getbuy() /获取进价 Float getsale() /获取售价 Char *getgys() /获取供应商 Void setid(int n) /输入id Void setname(char na) /产品名 Voi

    3、d setcount(int c) /库存量 Void setsalecount(int s) /已售量 Void setbuy(float i) /进价 Void setsale(float o) /售价 Void setgys(char g) /供应商;2、class commodity 商品类设计:class Commodity /商品类private: Data t50; /数组 int n; /商品数量public: void newFile() /添加商品信息 void showData(int i) /显示商品信息 void showData() /显示文字信息 void sav

    4、e() /写入数据至文件 int search() /商品查询 void sale() /商品销售结算 void showSale() /销售清单 inline void menu() /主菜单 3、本程序结构 (1)主函数 Void main() menu(); Commodity com; int c; switch(c)return Break;(2)数据类实现对数据的输入输出。(3)商品类系统各项功能的实现。三、详细设计 (1)数据类 class Data /数据类private: int id;/产品编号 char name100;/产品名称 int count;/库存数量 int

    5、salecount;/已售数量 float iprice;/进价 float oprice;/售价 char gys20;/供应商public: int getId() return id; char *getName() return name; int getCount() return count; int getSaleCount() return salecount; float getBuy() return iprice; float getSale() return oprice; char *getGys() return gys; /- void setId(int n)

    6、id=n; void setName(char na) strcpy(name,na); void setCount(int c) count=c; void setSaleCount(int s) salecount=s; void setBuy(float i) iprice=i; void setSale(float o) oprice=o; /. void setGys(char g) strcpy(gys,g); ;(2)商品类 class Commodity /商品类 private: Data t50; /数组 int n; /商品数量 public: void newFile(

    7、) int id; char name50; /字符数组 int count; float iprice; float oprice; char gys20; if(n0) n=0; int i; Data temp; for(;n+) coutid; if(id=-1) break; tn.setId(id); coutname; tn.setName(name); coutcount; tn.setCount(count); coutiprice; tn.setBuy(iprice); coutoprice; tn.setSale(oprice); coutgys; tn.setGys(g

    8、ys); tn.setSaleCount(0);/售出此产品0个 cout若商品添加完毕,请按-1退出添加!endl; for(i=0;itn.getId() temp=ti; ti=tn; tn=temp; void showData(int i) coutti.getId() setw(10)ti.getName() setw(10)ti.getCount() setw(10)ti.getSaleCount() 6 setw(8)ti.getBuy() setw(8)ti.getSale() setw(8)ti.getGys()endl; void showData() cout商品编号

    9、setw(8)商品名 setw(8)库存量 setw(10)已售量 setw(10)进价 setw(8)售价 setw(8)供应商endl; for(int i=0;i0 ) showData(i); cout产品种类:nendl; void save() /写入数据至文件 ofstream fout; fout.open(商品销售管理系统.txt); if(!fout) coutcannot open the file!endl; return ; fout商品编号 商品名 库存量 进价 售价 供应商 已售量endl; for(int i=0;in;i+) foutti.getId()set

    10、w(14)ti.getName()setw(10)ti.getCount()setw(10)ti.getBuy()setw(10)ti.getSale()setw(10)ti.getGys()setw(10)ti.getSaleCount(); cout*Save Success!*endl; fout.close(); int search() int id; coutid; int low=0,mid,high=n-1; while(lowid) high=mid-1; Else low=mid+1; return -1; void sale() cout产品编号; int temp; t

    11、emp=search(); if(temp=-1) coutcannot find the commodity!endl; return; if(ttemp.getCount()=0) cout此产品已缺!endl; int count; coutcount; float money; coutmoney; if(countttemp.getCount()/输入的是负数或超出该产品库存量 cout数量输入不正确endl; else if(moneyttemp.getSale()*count) 8 cout购物金额不足,还需增加金额ttemp.getSale()*count-money元endl

    12、; else ttemp.setCount(ttemp.getCount()-count);/当前库存减少count ttemp.setSaleCount(ttemp.getSaleCount()+count);/出售量增加count cout*名称:ttemp.getName()endl *数量:countendl *单价:ttemp.getSale()元endl *应收:count*ttemp.getSale()元endl *找零:money-count*ttemp.getSale()元endl *endl; void showSale() for(int i=0;i0 ) showDat

    13、a(i); ;(3)主函数inline void menu() cout *欢迎使用商品销售管理系统* endl; cout *主菜单* endl; cout (1)添加 endl; cout (2)保存 endl; cout (3)显示 endl; cout (4)菜单 endl; cout (5)销售单 endl; cout (0)退出系统 endl; cout *2011-2012* endl; void main() menu(); Commodity com; int c; for(;) coutc; switch(c) case 1:com.newFile();break; cas

    14、e 2:com.save();break; case 3:com.showData();break; case 4:menu();break; case 5:com.sale();break; case 0: cout *谢谢使用* endl; cout *!再见!* endl; return; break; 四、调试分析(1)、error C2143: syntax error : missing ; before 行246少了一个分号(2)、error C2562: main : void function returning a value空类型不能有返回值(3)、error C2679

    15、: binary : no operator defined which takes a right-hand operand of type (or there is no acceptable conversion) ti.getName后面少了()5、用户使用说明1、本程序的运行环境为windows操作系统,执行文件为Ks.exe;2、进入演示程序后,即显示对话形式的提示操作过程:如:第一项:(1)商品添加功能在选择一栏输入:1即显示商品编号、商品名、库存量、进价、售价、供应商各项商 品信息,依次输入所需添加的数据 。添加商品完毕,按-1退出添加。选择:2 即将商品信息保存。选择:3 显

    16、示已保存的商品信息。选择:4 重新回到主菜单。选择:5 进行商品销售结算。同时选择:3 显示商品库存和已销售的完整信息。六、测试结果 进入演示程序后,即显示对话形式的提示操作过程:选择:1 输入相应提示的商品信息选择:2 界面显示数据保存成功选择:3 显示商品信息 选择:4 重新回到主菜单选择:5 进行商品结算选择:3 显示商品信息7、附录程序源代码:#include#include#include#include /为了声明标识符setw()函数#define Mfname 100class Data /数据类private: int id;/产品编号 char name100;/产品名称

    17、int count;/库存数量 int salecount;/已售数量 float iprice;/进价 float oprice;/售价 char gys20;/供应商public: int getId() return id; char *getName() return name; int getCount() return count; int getSaleCount() return salecount; float getBuy() return iprice; float getSale() return oprice; char *getGys() return gys; /

    18、- void setId(int n) id=n; void setName(char na) strcpy(name,na); void setCount(int c) count=c; void setSaleCount(int s) salecount=s; void setBuy(float i) iprice=i; void setSale(float o) oprice=o; /. void setGys(char g) strcpy(gys,g); ;class Commodity /商品类private: Data t50; /数组 int n; /商品数量public: vo

    19、id newFile() int id; char name50; /字符数组 int count; float iprice; float oprice; char gys20; if(n0) n=0; int i; Data temp; for(;n+) coutid; if(id=-1) break; tn.setId(id); coutname; tn.setName(name); coutcount; tn.setCount(count); coutiprice; tn.setBuy(iprice); coutoprice; tn.setSale(oprice); coutgys;

    20、tn.setGys(gys); tn.setSaleCount(0);/售出此产品0个 cout若商品添加完毕,请按-1退出添加!endl; for(i=0;itn.getId() temp=ti; ti=tn; tn=temp; void showData(int i) coutti.getId() setw(10)ti.getName() setw(10)ti.getCount() setw(10)ti.getSaleCount() setw(8)ti.getBuy() setw(8)ti.getSale() setw(8)ti.getGys()endl; void showData()

    21、cout商品编号 setw(8)商品名 setw(8)库存量 setw(10)已售量 setw(10)进价 setw(8)售价 setw(8)供应商endl; for(int i=0;i0 ) showData(i); cout产品种类:nendl; void save() /写入数据至文件 ofstream fout; fout.open(商品销售管理系统.txt); if(!fout) coutcannot open the file!endl; return ; fout商品编号 商品名 库存量 进价 售价 供应商 已售量endl; for(int i=0;in;i+) foutti.getId()setw(14)ti.getName()setw(10)ti.getCount()setw(10)ti.getBuy()setw(10)ti.getSale()setw(10)ti.getGys()setw(10)ti.getSaleCount(); cout*Save Success!*endl; fout.close(); int search() int id; coutid; int low=0,mid,high=n-1; while(lowid) high=mid-1; els


    注意事项

    本文(101006434《商品销售管理系统》.docx)为本站会员主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2022 冰点文档网站版权所有

    经营许可证编号:鄂ICP备2022015515号-1

    收起
    展开