资源预览内容
第1页 / 共35页
第2页 / 共35页
第3页 / 共35页
第4页 / 共35页
第5页 / 共35页
第6页 / 共35页
第7页 / 共35页
第8页 / 共35页
第9页 / 共35页
第10页 / 共35页
亲,该文档总共35页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
西安邮电大学高级语言课程设计报告题 目: 超市管理系统院系名称: 理学院 专业名称: 应用物理学班 级: 1301 学生姓名: 王松学号(8位): 07132022指导教师: 王西龙设计起止时间:2014年06月19日2014年06月27日1:程序模型2:原函数概况1:创建函数void start(); /*启动界面*/void input(); /*商品数据信息输入函数*/void change(); /*商品数据信息修改函数*/void dele(); /*给定指定商品名称,删除商品信息*/void output(); /*商品信息输出*/void search(); /*商品信息查找*/void mima();/*密码程序*/void colour();/颜色选择void huanying();2:商品信息录入input()3:商品信息的修改Change()4:商品信息的删除Dele()5:商品信息的查询Seaerch()6:系统颜色选择Colour()7:退出系统3:详细设计过程1:结构体变量的定义struct MarketGoods /*存数商品信息的结构体*/ char goods_id30; /*商品编号*/ char goods_name30; /*商品名称*/double goods_price; /*商品价格*/double goods_discount;/*商品折扣*/int goods_amount;/*商品总数目*/int goods_remain;/*商品剩余数目*/goodsCOUNT;int count=0; /*全局变量,用于保存实际上有多少个商品*/2:欢迎界面void huanying()printf(t333333333333333333333333333333n); printf(t3 欢迎使用 3n); printf(t3 3n); printf(t3 3n); printf(t3 超市管理系统 3n); printf(t3 3n); printf(t3 3n); printf(t3 444444 3n); printf(t3 3n); printf(t3 555555555 3n); printf(t3 3n);printf(t3333333333333333333333333333333n);3:密码登陆void mima()/char pass6=1,2,3,4,5,6;/*假设密码长度是6*/ char pass=123456;/*假设密码长度是6*/ char str6,ch;int i=0;int flag=0;printf( 请输入密码:); fflush(stdin);for(i=0;i6;i+) ch=getch(); /*读取字符,不显示*/stri=ch;putchar(*); for(i=0;i6;i+)if(stri!=passi) flag=1;break;if(flag)printf(n密码错误,登录失败!请重新登录n);mima();else printf(n登录成功n);getch();system(cls);start();4:系统选择界面void start() /*启动菜单*/int chi; printf( 超市商品管理系统n);printf( *n); printf( *n); printf( 1.商品信息的录入:n);printf( 2.商品信息的修改:n); printf( 3.删除某个商品信息:n); printf( 4.查找商品信息:n); printf( 5.颜色选择:n); printf( 0.退出程序n);printf( *n); printf( *n); printf( 输入你的选择: ); scanf(%d,&chi); /*根据你的选择执行相应的函数*/if(chi=1) input(); else if(chi=2) change();else if(chi=3) dele();else if(chi=4) search(); else if(chi=5) colour();else if(chi=0) printf(你已经退出超市商品管理系统!谢谢您的使用,再见n); exit(0);elseprintf( You Enter The Choice Is Not valid ! n);getch();system(cls);start();void huanying()printf(t333333333333333333333333333333n); printf(t3 欢迎使用 3n); printf(t3 3n); printf(t3 3n); printf(t3 超市管理系统 3n); printf(t3 3n); printf(t3 3n); printf(t3 444444 3n); printf(t3 3n); printf(t3 555555555 3n); printf(t3 3n);printf(t3333333333333333333333333333333n);5:商品信息的录入void input() /*数据录入*/FILE *fp;char flag20;fp=fopen(e:/student.txt,wt);doprintf(请输入你的商品信息:n); /*录入商品的信息*/ printf(商品编号:); scanf(%s,goodscount.goods_id); printf(商品名字:); scanf(%s,goodscount.goods_name); printf(商品价格:); scanf(%lf,&goodscount.goods_price); printf(商品折扣:); scanf(%lf,&goodscount.goods_discount); printf(商品总数目:); scanf(%d,&goodscount.goods_amount); printf(商品剩余数目:); scanf(%d,&goodscount.goods_remain); count+; /*存数的商品数加一*/ printf(是否继续输入数据 y是 n否 : ); /*是否还想继续输入数据*/ sc
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号