ImageVerifierCode 换一换
格式:DOCX , 页数:28 ,大小:49.69KB ,
资源ID:9196127      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9196127.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C++课程设计《商品销售管理系统》.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C++课程设计《商品销售管理系统》.docx

1、C+课程设计商品销售管理系统C+课设 商品销售管理系统 一、需求分析.2二、概要设计.2三、详细设计.3四、调试分析.9五、用户手册.10六、测试数据.11七、附录.12 1一、需求分析 商品销售管理程序 商品信息:商品编号、商品名称、商品类别(普通电视机、DVD、带DVD的电视机,带DVD的电视机的售价为普通电视机和DVD单价之和的80%)、商品进货价格、商品销售价格、商品数量、供应商名称等。 记录每一次销售商品的数量和价格,并提供对已售出商品的价格、数量进行统计、排序功能,但允许用户退商品。(要求:1.源文件采用多文件的工程结构2.数据存储采用文件形式3.标准的C输入输出4.功能完善,适当

2、的注释,5.关于文件的内容需要自学)二、概要设计1、数据类(class Data)的数据类型定义:class Data /数据类private: int id; /产品编号 char name100; /产品名称 int count; /库存数量 int salecount; /已售数量 float iprice; /进价 float oprice ; /售价 char gys20; /供应商Public: /公有函数 int getid() /获取id char *getname() /获取产品名 Int getcount() /获取库存量 Int getsalecount() /获取已售量

3、 Float getbuy() /获取进价 Float getsale() /获取售价 Char *getgys() /获取供应商 2 Void setid(int n) /输入id Void setname(char na) /产品名 Void setcount(int c) /库存量 Void setsalecount(int s) /已售量 Void setbuy(float i) /进价 Void setsale(float o) /售价 Void setgys(char g) /供应商;2、class commodity 商品类设计:class Commodity /商品类priva

4、te: Data t50; /数组 2 int n; /商品数量public: void newFile() /添加商品信息 void showData(int i) /显示商品信息 void showData() /显示文字信息 void save() /写入数据至文件 int search() /商品查询 void sale() /商品销售结算 void showSale() /销售清单 inline void menu() /主菜单 3、本程序结构 (1)主函数 Void main() menu(); Commodity com; int c; switch(c)return Break

5、;(2)数据类实现对数据的输入输出。(3)商品类系统各项功能的实现。三、详细设计 (1)数据类 class Data /数据类private: int id;/产品编号 char name100;/产品名称 int count;/库存数量 int salecount;/已售数量 float iprice;/进价 float oprice;/售价 char gys20;/供应商public: int getId() return id; char *getName() return name; int getCount() 3 return count; int getSaleCount() r

6、eturn salecount; float getBuy() return iprice; float getSale() return oprice; char *getGys() return gys; /- 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

7、; 4 /. void setGys(char g) strcpy(gys,g); ;(2)商品类 class Commodity /商品类 private: Data t50; /数组 int n; /商品数量 public: void 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.s

8、etName(name); coutcount; tn.setCount(count); coutiprice; tn.setBuy(iprice); coutoprice; tn.setSale(oprice); coutgys; 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

9、.getCount() setw(10)ti.getSaleCount() 6 setw(8)ti.getBuy() setw(8)ti.getSale() setw(8)ti.getGys()endl; void showData() cout商品编号 setw(8)商品名 setw(8)库存量 setw(10)已售量 setw(10)进价 setw(8)售价 6 setw(8)供应商endl; for(int i=0;i0 ) showData(i); cout产品种类:nendl; void save() /写入数据至文件 ofstream fout; fout.open(商品销售管理系

10、统.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 sear

11、ch() int id; coutid; int low=0,mid,high=n-1; while(lowid) high=mid-1; Else low=mid+1; 7 return -1; void sale() cout产品编号; int temp; temp=search(); if(temp=-1) coutcannot find the commodity!endl; return; if(ttemp.getCount()=0) cout此产品已缺!endl; int count; coutcount; float money; coutmoney; if(countttemp

12、.getCount()/输入的是负数或超出该产品库存量 cout数量输入不正确endl; else if(moneyttemp.getSale()*count) 8 cout购物金额不足,还需增加金额ttemp.getSale()*count-money元endl; else ttemp.setCount(ttemp.getCount()-count);/当前库存减少count ttemp.setSaleCount(ttemp.getSaleCount()+count);/出售量增加count cout*名称:ttemp.getName()endl *数量:countendl *单价:ttem

13、p.getSale()元endl 8 *应收:count*ttemp.getSale()元endl *找零:money-count*ttemp.getSale()元endl *endl; void showSale() for(int i=0;i0 ) showData(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

14、(0)退出系统 endl; cout *2011-2012* endl; void main() menu(); Commodity com; int c; for(;) coutc; 9 switch(c) case 1:com.newFile();break; case 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

15、)、error C2143: syntax error : missing ; before 行246少了一个分号(2)、error C2562: main : void function returning a value空类型不能有返回值(3)、error C2679: binary : no operator defined which takes a right-hand operand of type (or there is no acceptable conversion) ti.getName后面少了()五、用户手册1、本程序的运行环境为windows操作系统,执行文件为Ks.

16、exe;2、进入演示程序后,即显示对话形式的提示操作过程:如:第一项:(1)商品添加功能在选择一栏输入:1即显示商品编号、商品名、库存量、进价、售价、供应商各项商 品信息,依次输入所需添加的数据 。添加商品完毕,按-1退出添加。选择:2 即将商品信息保存。选择:3 显示已保存的商品信息。选择:4 重新回到主菜单。选择:5 进行商品销售结算。同时选择:3 显示商品库存和已销售的完整信息。六、测试数据 进入演示程序后,即显示对话形式的提示操作过程:选择:1 10输入相应提示的商品信息选择:2 界面显示数据保存成功选择:3 显示商品信息 11选择:4 重新回到主菜单选择:5 进行商品结算选择:3 显

17、示商品信息七、附录程序源代码:#include#include#include#include /为了声明标识符setw()函数#define Mfname 100class Data /数据类private: int id;/产品编号 char name100;/产品名称 int count;/库存数量 int salecount;/已售数量 float iprice;/进价 float oprice;/售价 char gys20;/供应商public: int getId() return id; char *getName() return name; int getCount() re

18、turn count; int getSaleCount() return salecount; float getBuy() return iprice; 12 float getSale() return oprice; char *getGys() return gys; /- 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) ipric

19、e=i; void setSale(float o) oprice=o; /. void setGys(char g) strcpy(gys,g); ;class Commodity /商品类private: 13 Data t50; /数组 int n; /商品数量public: void 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; t

20、n.setId(id); coutname; tn.setName(name); coutcount; tn.setCount(count); coutiprice; tn.setBuy(iprice); coutoprice; tn.setSale(oprice); coutgys; tn.setGys(gys); tn.setSaleCount(0);/售出此产品0个 14 cout若商品添加完毕,请按-1退出添加!endl; for(i=0;itn.getId() temp=ti; ti=tn; tn=temp; void showData(int i) 15 coutti.getId(

21、) 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() 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) 15coutcannot open the file!endl; return ; fout商品编号 商品名 库存量 进价 售价 供应商 已售量endl; for(int i=0;in;i+) foutti.getId()setw(14)ti.getName()setw(10)ti

copyright@ 2008-2022 冰豆网网站版权所有

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