数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc

上传人:rrsccc 文档编号:8793539 上传时间:2021-01-16 格式:DOC 页数:50 大小:30.83KB
返回 下载 相关 举报
数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc_第1页
第1页 / 共50页
数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc_第2页
第2页 / 共50页
数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc_第3页
第3页 / 共50页
数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc_第4页
第4页 / 共50页
数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc_第5页
第5页 / 共50页
点击查看更多>>
资源描述

《数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc》由会员分享,可在线阅读,更多相关《数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program).doc(50页珍藏版)》请在三一文库上搜索。

1、数据结构课程设计商品货物管理系统源程序(Data structure curriculum design, commodity management system source program)#包括#包括。H / getch#包括 iostream。”#包括字符串。”#包括。H /系统退出米马/定义密码结构体结构int麻木;char名称 20 ;结构时间/定义时间结构体年份;月;国际日;结构/定义种类连表货物名称 20 ;/货物名char类型 50 ;/货物种类时间时间;/ /表示货物的进店时间时间时间;/ /表示保质期的截止时间数组的个数;/ /入店件数浮动价格;/ /进货价格浮动价格;/

2、 /销售价格货物*下;sellstore() /卖货总函数无效;bool SellOneInfo(角色名字 30 ,int sellcount);/ /卖货* FindOneInfo(商品名称 30 );/查找无效findstore();/ /查找函数(数量为0商品,和指定名称的商品prin() /输出函数无效;无效wwx1();/ /初始化利润统计(S 数组)wwx2() /页面函数无效;无效managestore();/ /管理函数(添加,修改,查找没有货商品)showallinfo() /显示所有商品函数无效;addgoods() /添加函数无效;无效showoneinfo(货物* p)

3、;/显示一件商品函数无效myread(int num);/ /读文件函数profit() /利润函数无效;无效delegoods2();/ /删除数量为0函数delegoods() /删除函数无效;删除空行(角色名字 20 );/删除指定货物函数fgoodsinfo() /寻找库存为空的货物无效;无效editgoodsinfo(角色名字 20 );/修改函数wwx() /退出页面无效;无效的极其(文件,货物IP);/ /写入的过程无效的输出(文件、物品* IP);/ /读的过程mywrite1() /刷新函数无效;mywrite() /追加函数无效;secret() /密码函数无效;cha()

4、 /指定位置插入无效;pai() /冒泡排序无效;无效fcha();货物第一=新产品;/ /全局指针漂浮的 100 ;/统计每一次的利润在z = 0;/销售次数浮SS = 0;/统计总利润int num;/ /种类数量国际main() = 0;/ / / / /调用密码函数secret();第一个下一个= null;如果(第一个= NULL)cout “初始化货物信息不成功”;返回0;myread(100);/读入文件信息系统(“颜色3”);/ /颜色wwx1();/ /初始化利润统计的数组系统(“华彩”);/ /清屏环:/ /标签wwx2();/ /页面cout “T T = = = = =

5、 = = *商店货物管理系统*” endl endl;cout “承办业务:n 1。添加和管理货物2。销售货物3。查询货物n 4。删除货物5。利润统计6。退出使用n“;prin();int选择= 0;选择;系统(“CLS”);如果(选择= = 1) managestore();如果(选择= = 2) sellstore();如果(选择= = 3) findstore();如果(选择= = 4) delegoods();如果(选择= = 5) profit();如果(选择= = 6) wwx();return 0;goto Loop;无效fcha() /按类型查找 int I;char LX 3

6、0 ;cout LX;货物=先到下;货物新货物;而(P!= null)如果(!strcmp(P ,LX)q =计数= p 计数;strcpy(Q,P的那种);strcpy(Q的名字,P的名字);Q 价格= P 价格;问:价格= P 价格;Q 时间= P1;Q 时间= P 时间;ShowOneInfo(Q);下一页;cout “是否需要销售:1。需要2。不需要:“ 2 | |我1)cout 价格 Q 价格)/比较销售价格 strcpy(T,P类);strcpy(t 的名字,P的名字);T价格= P 价格;t 时间= P 时间;t 时间= P 时间;t 数= P 计数;t 价格= P 价格;str

7、cpy(P ,Q类);strcpy(P 的名字,问-名称);P = Q 价格价格;P 时间= Q1;P = Q 时间时间;P 数= Q计数;P = Q 价格价格;strcpy(Q,t 类);strcpy(Q -名称-名称T);Q 价格= t 价格;Q1 = t 时间;Q时间= t 时间;Q 数= t 计数;Q价格= t 价格;下一步;下一步;M;如果(J = = num-1)M = 1;其他M = 1;/判断是否循环结束返回;无效cha() /指定位置的插入系统(“颜色6”);货物* q第一;int = i 1;int m0;cout “请输入要插入的位置(1到”民 我;/ /民为总数如果(我

8、民| |我1) cout “输入有误!“”按任意键返回” endl;getch();系统(“华彩”);返回;别的货物=新货物;货物*;cout 磷;CIN的名字;cout 磷;CIN计数;cout ;CIN P 类;cout ;CIN P 价格;cout ;CIN P 价格;cout P 时间。年P 时间。月 磷 time1.day;cout 磷 2.年P 时间。月 磷 time2.day;当(q)!= null & M I-1) q = q -下;M + +; /找到插入位置的前一个P 下= Q /需插入的指针指向下一个下;Q 下= P;系统(“华彩”);/ /前一个指针指针指向需插入的指针

9、cout “插入成功” endl;getch();Num + +;/ /总数加一mywrite1(); /重新写入返回;无效secret() int = i 3;int j;系统(“颜色3”);cout J;系统(“华彩”);开关(j)案例1:美马P =新的密码;美马*q =新的密码;文件*;FP = fopen(“F:密码.txt”、“R”);如果(FP = NULL)printf(“无法打开文件。n”);getch();出口(0);fscanf(FP,“%s”,P的名字,普-麻木);关闭文件(FP);(i0)cout “请输入账户”;名称;cout 的名字,问-名称)和P -麻木= = Q

10、 -麻木)如果(p麻木)返回;其他的cout “密码错误或用户名错误”;我;cout “你还有”我的“次机会cout endl;!”;getch();系统(“CLS”);案例2:美马*q =新的密码;文件*;FP = fopen(“F:密码.txt”、“W”);如果(FP = NULL)printf(“无法打开文件。n”);getch();出口(0);cout “请输入账户”;名称;cout 麻木);cout “请重新登陆!”;关闭文件(FP);getch();出口(0);无效myread(int i)/从文件读入系统(“颜色7”);文件*;FP = fopen(“F:输入.txt”、“R”)

11、;如果(FP = NULL) printf(“无法打开文件。n”);getch();出口(0);对于(j = 0;j 名称-名称,IP)继续;q = IP;下一步;第一个下一个= IP;数字+;系统(“CLS”);关闭文件(FP);返回;无效mywrite1() /刷新系统(“颜色4”);货物=新货物;系统(“CLS”);系统(“颜色7”);文件*;FP = fopen(“F:输入.txt”、“W”);如果(FP = NULL) printf(“无法打开文件。n”);getch();出口(0);下一步;对于(int = i 0;i 数字;i + +)极其(FP,IP);下一步;关闭文件(FP)

12、;无效prin()cout “请选择:”;无效profit() wwx2();系统(“颜色8”);intz;cout “总利润为:”;cout SS;cout “n每一次利润” 0)cout “第” O + 1 “次的利润”的阿 “t” endl;cout “任意键返回”名称-,IP,和IP -计数,与IP -价格,与IP -价格);fscanf(FP,“%d %d %d”,与IP -时间。年,与IP -时间。月,与IP -时间。天);fscanf(FP,“%d %d %d”,与IP - time2.year,与IP -时间。月,与IP -时间一天);无效的极其(文件,货物IP =新产品) f

13、printf(FP,“%s %s %d f f”,IP -名称-,IP,IP - -价格算,IP,IP -价格);fprintf(FP,“%d %d %d”,IP -时间。年,IP -时间。月,IP -时间。天);fprintf(FP,“%d %d %dn”,IP -时间。年,IP -时间。月,IP -时间。天);无效mywrite()系统(“CLS”);系统(“颜色7”);n,i;文件*;FP = fopen(“F:输入。txt”,“”);如果(FP = NULL) printf(“无法打开文件。n”);getch();出口(0);cout “你想输入几组数据:”;我;对于(n0;n 下=

14、IP;cout “插入成功!” endl;关闭文件(FP);getch();系统(“华彩”);返回;无效showoneinfo(货物* P)/货物信息系统(“CLS”);系统(“颜色A”);cout “货物类型:“类 endl;cout “=” endl;cout “货物名:”的名字 endl;cout “总数量”算“件” endl;cout “进货价格”价格“元” endl;cout “销售价格”价格“元” endl;cout “进店时间” P1。年“年” P1。月“月” P1。天“日” endl;cout “过期时间” P1。年“年”时间。月“月”时间。天“日” endl;cout “=”

15、 endl;cout endl;无效managestore() /处理连表中的信息,系统(“颜色B”);系统(“CLS”);wwx2();环:cout “n n *功能区1。追加货物2。指定位置添加货物3。修改货物信息n“;cout “T 4。查看没有存货的商品5。返回主菜单* n“;prin();int选择= 0;选择;系统(“CLS”);焦goodsname 30 ;如果(选择= 4)fgoodsinfo();/ /寻找库存为空的货物如果(选择= 3)cout goodsname;EditGoodsInfo(goodsname);如果(选择= 2)cha();如果(选择= 1)cout “

16、添加货物” endl;mywrite();如果(选择= 5)系统(“CLS”);返回;goto Loop;无效addgoods() /添加函数系统(“颜色F”);货物=新货物;cout 磷;CIN的名字;cout 磷;CIN计数;cout ;CIN P 类;cout ;CIN P 价格;cout ;CIN P 价格;cout P 时间。年P 时间。月 磷 time1.day;cout 磷 2.年P 时间。月 磷 time2.day;下一个;第一个下一个;无效showallinfo() /所有货物信息系统(“颜色D”);int i;货物*;当(q)!= null)showoneinfo(Q);q

17、 = q 下;getch(); cout “是否需要销售:1。需要2。不需要:“ 2 | |我1)cout “输入有误”;否则如果(i = 1) sellstore();否则系统(“CLS”);返回;无效wwx2() /页面函数cout “* * * *商店货物管理系统n“;cout “n“;cout “=n“;cout “n“;cout “n“;cout “n“;cout “n“;cout “【计算机与通信学院】n“;cout “【软件一班开发】n“;cout “n“;cout “作者:XXXXn“;cout “学号:09250301n“;cout “时间:2010年6月n“;cout “n

18、“;cout “n“;cout “=欢迎使用=n“;cout “n“;cout “n“;cout endl;无效wwx1() /初始化利润统计int v;对于(v0;v99;+)s0;无效findstore() /查找功能系统(“颜色C”);系统(“CLS”);int选择0;char名称 30 ;货物* = null;环:cout “n *查看功能区:1。某商品信息2。商店全部货物3。按销售价格排序4。按类型分类5。返回主菜单* n“;prin();选择;系统(“CLS”);如果(选择= 1)cout 的名字;P = FindOneInfo(名);如果(p = NULL)cout “抱歉!目前

19、商店没有改货物n“;如果(选择= = 2) showallinfo();如果(选择= = 3) pai();showallinfo();如果(选择= = 4) fcha();如果(选择= 5)系统(“CLS”);返回;goto Loop;/ /返回到标签无效sellstore() /销售货物系统(“颜色E”);焦goodsname 30 ;int计数= 0;cout goodsname”;货物P = FindOneInfo(goodsname);如果(p = NULL)cout “没有该商品没有你找的货物” endl;getch();系统(“华彩”);返回;其他的cout 计数;如果(p =

20、计数=计数)如果(SellOneInfo(goodsname,计数)= =真)系统(“CLS”);回报;系统(“CLS”);cout “货物不足,销售失败”;cout “任意键返回”的名字,名字)= = 0)showoneinfo(P);getch();返回p;下一页;返回null;bool SellOneInfo(角色名字 30 ,int sellcount)/卖货系统(“华彩”);/ / wwx2();货物=先到下;而(P!= null)如果(strcmp(P 的名字,名字)= = 0)showoneinfo(P);P 计数= sellcount;S Z =浮(Pprice2-p -价格)

21、* sellcount);SS,SS +(Pprice2-p -价格)* sellcount;+;cout “销售成功n“;cout “本次不错,赚”的 1 “元” endl;cout “任意键返回” endl;getchar();mywrite1();返回true;下一页;返回false;无效delegoods() /删除系统(“CLS”);wwx2();系统(“颜色2”);int类型= 0;名称 20 ,名 20 ;char a = a;环:cout “选择删除项1指定货物2库存为0的货物n“;prin();类;系统(“CLS”);如果(= = 1) cout 的名字;cout name1

22、;如果(!strcmp(名称、姓名)乐乐(化名);其他的cout “两次输入有误”;/ /删除商品否则如果(类= 2) cout “确认删除库存为0的商品,请输入Y N”;CIN;如果(= = Y | | = = Y)delegoods2();/ /删除货物为0商品别的 cout “输入有错,继续输入”;货物*;int = 0,m =数值;T =第一;系统(“颜色5”);同时(P!= NULL)如果(p)计数!= 0)Tp;下一页;其他的下一步;下一行;如果(m) cout “删除成功!n“”任意键返回” endl;getch();其他的cout did not find n, any key

23、 to return; next;Goods *t=first;Int, n=0, m=num;While (P! =NULL) / / find the appropriate productn=strcmp (p-name, name); /n=0 stands for the same nameIf (n=0)p=p-next; / / to the next commodityT-next=p; / / before a commodity to the next of the next commodity deleteNum-;ElseT=p;P=p-next; / / to the

24、 next commodity if (mnum)cout delete successfully.! n any key to return endlElsecout did not find this item! next;Int n=0;Char m;M=a;While (P, =NULL)If (p-count=0)N+;ShowOneInfo (P); / / display of goodsP=p-next;If (n=0)Cout there is no empty n for the time being.;ElseCout common n is empty;Void (WW

25、X) / exit pagessystem (color 2); int, I, j;Char, a580, b580;For (i=0; i3; i+)if (i%2)For (j=0; j80; j+)Aij=;ElseFor (j=0; j80; j+)Aij=*;For (i=0; i3; i+)if (i%2)For (j=0; j80; j+)Bij=-;ElseFor (j=0; j80; j+)Bij=*;Cout n;For (i=0; i3; i+)for (j=0; j80; j+)Coutaij; coutendl;Cout tt=* store goods manag

26、ement system *+= endl;Cout tttttt Author: Zhang Bin endl;Cout tttttt completes the time, June 10, 2009, endl;Cout tttttt, thanks for using endl;For (i=0; i3; i+)for (j=0; j80; j+)Coutbij; cout endl;Void EditGoodsInfo (char name20) / / Editorsystem (color 7); /wwx2 ();Goods *p=NULL; Goods *q=new Good

27、s; Goods *t=new Goods;P=FindOneInfo (name);Int k=0;Loop: coutk;System (CLS);Switch (k)Case 1:Coutt-name;Coutq-name;If (! StrCmp (t-name, q-name) / / verify whether the input is consistentcout modify successfully; name; t-name);Else cout two inputs are inconsistent; endl; mywrite1 ();Break;Case 2:Cou

28、tt-kind;Coutq-kind;If (. StrCmp (t-kind, q-kind)cout modify successfully cheek, t - cheek);else cout 两次输入不一致 final;mywrite1 ();break;case 3:cout t time2.year t time2.month t time2.day;cout q time2.year q time2.month q time2.day;if (t - time2.year = = q - time2.year)if (t - time2.month = = q - time2.

29、month)if (t - time2.day = = q - time2.day)cout 修改成功 time2.year = t - time2.year;p - time2.month = t - time2.month;p - time2.day = t - time2.day;cout time2.year time2.month time2.day;elsecout 输入日期不对 final;elsecout 输入月份不对 final;elsecout 输入年份不对 final;mywrite1 ();break;case 6:cout t time1.year t time1.month t time1.day;cout q time1.year q time1.month q time1.day;if (t - time1.year = = q - time1.year)if (t - time1.month = = q - time1.month)if (t - time1.day = = q - time1.day)cout 修改成功

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1