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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

商品信息管理系统C语言课程设计.docx

1、商品信息管理系统C语言课程设计#include#include#include#include#define N 100struct commodity char option20; char name20; char price10; char production_date8; char stale_date8; char finished_goods20; char saleroom20;void print_1();void create();void edit();void print_2(); /*invoked of edit*/void edit_add(); /*invoke

2、d of edit*/void edit_modify(); /*invoked of edit*/void edit_delete(); /*invoked of edit*/void delete_option(); /*invoked of 2delete*/void delete_name(); /*invoked of 2delete*/void show();void search();void search_option(); /*invoked of search*/void search_name(); /*invoked of search*/main() char cho

3、ose=0,yes_no=0; do print_1(); choose=getch(); switch(choose) case1:create();break; /*create information of commodity*/ case2:edit();break; /*edit information of commodity*/ case3:show();break; /*show information of commodity*/ case4:search();break; /*search information of commodity*/ case0:exit(0);

4、default:printf(n %c is illegality option!n,choose); printf(n Do you want to continue(y/n)?); do yes_no=getche(); while(yes_no!=Y&yes_no!=y&yes_no!=N&yes_no!=n); while(yes_no=Y|yes_no=y);void print_1() /*show limiting surface of menu*/ clrscr(); /*clearn screen of function*/ printf(*n); printf(* Mana

5、gesystem of Commodity Information *n); printf(*n); printf( |*|n); printf( | Please input option number |n); printf( |n); printf( | 1-Create commodity information |n); printf( | 2-Edit commodity information |n); printf( | 3-Show commodity information |n); printf( | 4-Search commodity information |n);

6、 printf( | 0-Exit system |n); printf( |*|n);void create() /*create information of commodity for function*/ int i=0,j,num; struct commodity temp=0; FILE *fp=NULL; fp=fopen(D:commodity.txt,w); if(fp=NULL) printf(n File of information of commodity opening failed.n); return ; clrscr(); /*clearn screen o

7、f function*/ printf(Please input want to input the number of goods!); scanf(%d,&num); for(j=1;num=j;j+) printf(nPlease input %d record:n,j); printf( number:); do gets(temp.option); while(strcmp(temp.option,)=0); printf( name:); gets(temp.name); printf( price:); gets(temp.price); printf( production:)

8、; gets(temp.production_date); printf( stale_date:); gets(temp.stale_date); printf( finished_goods:); gets(temp.finished_goods); printf( saleroom:); gets(temp.saleroom); fprintf(fp,%s %s %s %s %s %s %sn,temp.option,temp.name,temp.price, temp.production_date,temp.stale_date,temp.finished_goods,temp.st

9、ale_date); i+; fclose(fp);void edit() /*edit information of commodity for function*/ char choose=0,yes_no=0,pass20=0,old20=0,w; int i=0,j,m=0; FILE *fp_code; fp_code=fopen(D:code.txt,r); if(fp_code=NULL) printf(n File of code opening failed.n); return ; fscanf(fp_code,%s,old); fclose(fp_code); for(j

10、=0;j=3) exit(1); do print_2(); printf( ); choose=getch(); switch(choose) case1:edit_add();break; /*add new information of commodity*/ case2:edit_modify();break; /*modify information of commodity*/ case3:edit_delete();break; /*delete information of commodity*/ case0:exit(0); default:printf(n %c is il

11、legality option!n,choose); printf(n Do you want to continue(y/n)?); do yes_no=getche(); while(yes_no!=Y&yes_no!=y&yes_no!=N&yes_no!=n); while(yes_no=Y|yes_no=y);void print_2() /*show limiting surface of menu*/ clrscr(); /*clearn screen of function*/ printf(*n); printf(* Managesystem of Commodity Inf

12、ormation *n); printf(*n); printf( |*|n); printf( | Please input option number |n); printf( |n); printf( | 1-Add commodity information |n); printf( | 2-Modify commodity information |n); printf( | 3-Delete commodity information |n); printf( | 0-Exit system |n); printf( |*|n);void edit_add() /*add new

13、information of commodity*/ char c=0; int n=0; struct commodity temp=0,recordN=0,*p=NULL; FILE *fp=NULL; fp=fopen(D:commodity.txt,r); if(fp=NULL) printf(n File opening failed.n); return; p=record; while(feof(fp)=0) fscanf(fp,%s%s%s%s%s%s%s,p-option,p-name,p-price,p-production_date,p-stale_date, p-fin

14、ished_goods,p-saleroom); p+; n+; fclose(fp); do printf(n Please input new option:); do gets(temp.option); while(strcmp(temp.option, )=0); printf( Please input new name:); gets(temp.name); printf( Please input new price:); gets(temp.price); printf( Please input new production:); gets(temp.production_

15、date); printf( Please input new stale_date:); gets(temp.stale_date); printf( Please input new finished_goods:); gets(temp.finished_goods); printf( Please input new saleroom:); gets(temp.saleroom); for(p=record;poption)=0) printf(n The option is repeat,if you want to input again(y/n)?); do c=getche()

16、; while(c!=Y&c!=y&c!=N&c!=n); putchar(n); break; if(p=record+n) *p=temp; break; while(c=y|c=Y); fp=fopen(D:commodity.txt,w); if(fp=NULL) printf(n File opening failed.n); return; for(p=record;poption,p-name,p-price,p-production_date,p-stale_date, p-finished_goods,p-saleroom); fclose(fp);void edit_mod

17、ify() /*modify information of commodity*/ char c=0; int n=0; struct commodity *find=NULL,temp=0,record100=0,*p=NULL; FILE *fp=NULL; fp=fopen(D:commodity.txt,r); if(fp=NULL) printf(n File opening failed.n); return; p=record; while(!feof(fp) fscanf(fp,%s%s%s%s%s%s%s,p-option,p-name,p-price,p-productio

18、n_date,p-stale_date, p-finished_goods,p-saleroom); p+; n+; fclose(fp); if(n=0) printf(n No record in this file.n); return; printf(n Please input you want to commodityoption:); gets(temp.option); for(p=record;poption)=0) find=p; break; if(p=record+n) printf(n No this commodity.n); return; do printf(n

19、 Please input right option.:); do gets(temp.option); while(strcmp(temp.option, )=0); printf( Please input right name:); gets(temp.name); printf( Please input right price:); gets(temp.price); printf( Please input right production:); gets(temp.production_date); printf( Please input right stale_date:);

20、 gets(temp.stale_date); printf( Please input right finished_goods:); gets(temp.finished_goods); printf( Please input right saleroom:); gets(temp.saleroom); for(p=record;poption)=0&(p!=find) printf(n The option is repeat,do you want to continue?(y/n); do c=getche(); while(c!=Y&c!=y&c!=N&c!=n); putcha

21、r(n); break; if(p=record+n) *find=temp; break; while(c=y)|(c=Y); fp=fopen(D:commodity.txt,w); if(fp=NULL) printf(n File opening is failed.n); return; for(p=record;poption,p-name,p-price,p-production_date,p-stale_date, p-finished_goods,p-saleroom); fclose(fp);void edit_delete() /*delete information o

22、f commodity*/ char c=0; printf(n According to the option(o) to delete, delete or by the name(n)?); c=getche(); if(c=o|c=O) delete_option(); else if(c=n|c=N) delete_name(); else printf(n This char is illegal.n);void delete_option() /*delete information of commodity by option*/ char tempoption10= ; in

23、t n=0; struct commodity recordN=0,*p=NULL,*k=NULL; FILE *fp=NULL; fp=fopen(D:commodity.txt,r); if(fp=NULL) printf(n File opening is failed.n); return; p=record; while(!feof(fp) fscanf(fp,%s%s%s%s%s%s%s,p-option,p-name,p-price,p-production_date,p-stale_date, p-finished_goods,p-saleroom); p+; n+; fclose(fp); printf(n Please input you want to delete the option:); gets(tempoption); for(k=record;koption)=0) break; if(krecord+n) for(p=k;pk+n-1;p+) *p=*(p+1); else printf(n No such commodify.n); fp=fopen(D:commodi

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

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