


版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、课程设计课程名称 C 语言程序设计课程设计 A题目名称 商场收银系统目录1 系统分析 错误 !未定义书签课程设计内容 错误 !未定义书签系统功能需求分析 错误 !未定义书签数据结构设计 错误 !未定义书签2 系统设计 错误 !未定义书签总体设计 错误 !未定义书签详细设计 错误 !未定义书签界面设计 错误!未定义书签各功能模块的设计 错误 !未定义书签3 系统编码设计 错误 !未定义书签main 函数 错误 ! 未定义书签4 系统运行 错误 !未定义书签5 总结 错误 !未定义书签1 系统分析课程设计内容 建立一商品信息文件,商品信息包括商品编号、商品名、商品类别、商品数量、 商品价格等。建立
2、一商场收银系统,功能包括:1. 系统登录:运行系统时,收银员应输入姓名(或编号)及密码,验证后方可 使用系统。2. 收银操作:收银员逐条输入商品编号及数量,系统自动计算金额,输入完毕 后显示应付款,当输入实收额后,计算出找赎值。3. 交易完成后按一定格式显示回单(格式参照一般超市中的打印小票) 。4. 保存所显示的回单。5. 自动按销售情况更新商品信息文件中的数据。6. 查询收银员销售信息。7. 浏览库存商品信息。系统功能需求分析本系统应具有以下功能:1、文件操作功能 进行商品信息管理,以文本的形式保存商品最新信息2、数据输入功能个人登录,消费商品基本资料的输入,销售信息输入等3、数据添加、修
3、改、删除功能 商品数据更新,个人入库信息修改更新4、计算功能基本计算功能,销售额处理5、查询功能资料库信息查询7、数据显示功能保障客户知情权,对系统输入输出信息的显示2 系统设计总体设计按系统分析的功能要求将系统划分为以下几个主要功能模块:1、建立新文本库信息模块2、销售系统模块3、商品销售信息回单模块4、商品库更新模块5、销售回单保存模块详细设计界面设计1、菜单设计主菜单:子菜单:2、输入界面的设计3、信息显示界面的设计各功能模块的设计根据划分的功能模块,定义以下函数实现各功能: (这部分应介绍各函数的原型,各功能模块实现所用的算法,可用流程图描述)1、主函数 main()2、charge
4、函数、 receipt_m 函数3、input_s 函数4、disp 函数3 系统编码设计重要的代(这部分将代码列出, 注意, 每个函数开始处要介绍函数的功能, 码应有注释,代码格式按锯齿式编排)main 函数void main()/* 主函数:密码登陆与主页面显示使用 */int key,j;int x,i;void openf();void newf();loop1:clrscr();gotoxy(10,4);for(i=0;i<20;i+)printf("# ");gotoxy(10,16);for(i=0;i<20;i+)printf("# &
5、quot;);gotoxy(16,5);printf("this is the salesperson systemn");gotoxy(16,7);printf(" iput your number:n");gotoxy(16,8);scanf("%s",salesperson_num);gotoxy(16,9);printf(" input your key;n");gotoxy(16,10);scanf("%d",&key);for(j=0;j<3;j+) if(strcmp
6、(salesperson_num,salespersonj.num)=0&&key=salespersonj.key) break;clrscr();printf("tyour number or key is wrongn");printf("tplease land againn");getch();goto loop1;clrscr 函数/* 主页面显示代码,子函数选择界面 */ gotoxy(16,8);printf("welcome to use the systemn");gotoxy(16,10);pri
7、ntf("press enter to continue");getch();doclrscr();gotoxy(10,5); for(i=0;i<20;i+) printf("* ");gotoxy(16,8);printf("1. build the goods warehouse"); gotoxy(16,9);printf("2. charge system"); gotoxy(16,10);printf("3. receipt message"); gotoxy(16,11);p
8、rintf("4. add to goods message"); gotoxy(16,12);printf("5. sell message"); gotoxy(16,13);printf("6. display goods stock"); gotoxy(16,14);printf("7. exit"); gotoxy(10,16);for(i=0;i<20;i+)printf("* "); gotoxy(16,18);printf("please select the me
9、nu:"); scanf("%d",&x);while(x<1|x>8);switch(x) case 1:newf(); break; case 2:charge();break; case 3:receipt_m();break; case 4:input_s();break; case 5:sell_m();break; case 6:disp();break; case 7:exit();while(1);newf 函数*/* 新建库信息函数,建立新文档存储更新商品信息 void newf() void openf();int i,x;
10、clrscr();doclrscr(); gotoxy(10,5);for(i=0;i<20;i+) printf("* ");gotoxy(16,8);printf(" new warehouse filename n"); gotoxy(16,9);printf(" the goods message"); gotoxy(16,10);printf(""); gotoxy(10,16); for(i=0;i<20;i+) printf("* ");gotoxy(16,18);pr
11、intf("please select the menu:"); scanf("%d",&x);switch(x) case 1:openf(); break;case 2:input_s();break;case 3:exit();while(1);void openf()int i;char f; clrscr();/*system("cls");*/printf("tinput the warehouse filename pleasen"); scanf("%s",xname);
12、fp=fopen("xname","a");fp1=fopen("","w"); fprintf(fp1,"%dt%d",n,n1);fclose(fp1);fp2=fopen("","w");fp3=fopen("","w");printf("tYou were built the warehouse n"); printf("ntcontinue to add goods messa
13、ge(y/n)");f=getch();if(f='y')input_s();charge 函数/* 销售信息管理系统 */charge()int i,j,f;int No;float sum=0;float change,receive;clrscr();gotoxy(10,5);for(i=0;i<20;i+)printf("* ");fp1=fopen("","r");fscanf(fp1,"%d%d",&n,&n1);fclose(fp1);if( fp=fo
14、pen("","r")!=NULL)for(i=0;i<n;i+)fscanf(fp,"%d%s%d%d",&goodsi.num,,&goodsi.price,&goodsi.amount);doprintf("ntNo.:t");scanf("%d",&No);printf("ntamount:t");scanf("%d",&j);No-;n1+;goodsNo.amount-;sum
15、+=j*goodsNo.price;fp2=fopen("","a");fprintf(fp2,"%st%dt%st%dt%dn",salesperson_num,goodsNo.num,goodsN ,goodsNo.price,j);fclose(fp2);fp3=fopen("","a");fprintf(fp3,"%dnt%d",goodsNo.num,j);fclose(fp3);f=getch();if(f=0) getch(); break;whil
16、e(1); printf("ntsum:t%",sum); printf("nntreceive:t"); scanf("%f",&receive); change=receive-sum; printf("ntchange:t%",change); fp3=fopen("","a");fprintf(fp3,"nt%nt%nt%",sum,receive,change);fclose(fp3); fp=fopen("",&qu
17、ot;w");for(i=0;i<n;i+)fprintf(fp,"%dt%st%dt%dn",goodsi.num,,goodsi.price,goodsi .amount);fclose(fp); fp1=fopen("","w"); fprintf(fp1,"%dt%d",n,n1); fclose(fp1); gotoxy(10,20);for(i=0;i<20;i+)printf("* "); gotoxy(16,22); printf(&q
18、uot;Press any key to exit"); getch();receipt 函数/* 客户回单信息 */ receipt_m() int i,No,j;float change,receive,sum; clrscr();gotoxy(10,5);for(i=0;i<20;i+)printf("* ");fp1=fopen("","r");fscanf(fp1,"%d%d",&n,&n1); fclose(fp1);if( fp3=fopen("",
19、"r")!=NULL) for(i=0;i<n1;i+) fscanf(fp3,"%dt%dt%ft%ft%f",&goodsNo.num,&j,&sum,&receive,&change); for(i=0;i<n1;i+) printf("ntNo:t%dntamount:t%dntsum:t%ntreceive:%ntchange:t%n",goo dsNo.num,j,sum,receive,change);fclose(fp3);elseprintf("error
20、n"); gotoxy(10,20);for(i=0;i<20;i+)printf("* "); gotoxy(16,22); printf("Press any key to exit"); getch();input 函数/* 库存信息更新 */ input_s() int i,f,j=0;clrscr();printf("tthis is the goods stock,please add the goods messagen"); printf("num:name:price:amount:n&qu
21、ot;);fp1=fopen("","r");fscanf(fp1,"%d%d",&n,&n1);fp=fopen("","a");for(i=0;i+,j+) scanf("%d%s%d%d",&goodsi.num,,&goodsi.price,&goodsi.amount );n+;fp1=fopen("","w"); fprintf(fp1,"%dt%d&q
22、uot;,n,n1); fclose(fp1);printf("ncontinue(y/n)");f=getch();if(f='n')break;for(i=0;i<=j;i+)fprintf(fp,"%dt%st%dt%dn",goodsi.num,,goodsi.price,goodsi .amount);fclose(fp);gotoxy(16,20);printf("press any key to break"); getch();sell 函数/* 显示最近销售信息 */ se
23、ll_m() int i,j,No;clrscr(); gotoxy(10,5);for(i=0;i<20;i+)printf("* "); printf("ntsalesperson_numtnumtnametpricetsell_numn");fp1=fopen("","r"); fscanf(fp1,"%d%d",&n,&n1);fclose(fp1);if( fp2=fopen("","r")!=NULL) for(i=0;i
24、<n1;i+)fscanf(fp2,"%st%dt%st%dt%dn",salesperson_num,&goodsNo.num,goodsN ,&goodsNo.price,&j);for(i=0;i<n1;i+)printf("t%stt%dt%st%dt%dn",salesperson_num,goodsNo.num,goodsN, goodsNo.price,j);fclose(fp2);elseprintf("errorn"); gotoxy(10,20);for(
25、i=0;i<20;i+)printf("* "); gotoxy(16,22); printf("Press any key to exit"); getch();display 函数/* 显示最近销售的库存信息 */disp()int i;clrscr();gotoxy(10,5);for(i=0;i<20;i+)printf("* ");printf("ntinput the warehouse filenamen"); gotoxy(10,7);scanf("%s",xname); printf("tNo.tnametpricetamountn");fp1=fopen("","r"); fscanf(fp1,"%d",&n);if( fp=fopen(xname,"r")!=NULL) for(i=0;i<n;i+)fscanf(fp,"%d%s%
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 乡镇房屋转让合同范本
- 车子定金合同范本
- 专职义工合同范本
- 养猫租房合同范本
- 个体店合作合同范本
- 农用汽车租赁合同范本
- 入驻超市合同范本
- 代养猪合同范本
- 个人投资公司合同范本
- 个人与企业协议合同范本
- 上海市建设工程施工图设计文件勘察设计质量疑难问题汇编(2024 版)
- 《康复工程学》课件-第一讲 康复工程概论
- 2025年度智慧医疗服务平台建设合同范本
- 2024项目管理人员安全培训考试题(审定)
- 2025四川宜宾市高县县属国企业第一次招聘3人易考易错模拟试题(共500题)试卷后附参考答案
- 2024 年国家公务员考试《申论》(地市级)真题及答案
- 2024年沈阳职业技术学院高职单招语文历年参考题库含答案解析
- 《榜样9》观后感心得体会一
- 2024年上海普陀区司法局招聘人民调解员考试真题
- 驾照考试题库及答案(完整版)
- 2024年3、6、9月青少年软件编程Python等级考试一级真题(全3套 含答案)
评论
0/150
提交评论