




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、作品名稱開(kāi)發(fā)者:系統(tǒng)背景:本軟件能減輕對(duì)貨物數(shù)目管理及價(jià)格盈虧等信息處理的工作量以便能快捷及時(shí)準(zhǔn) 確的調(diào)整貨物的倉(cāng)儲(chǔ)量達(dá)到最合理化??梢允沟曛鞑皇实墓?jié)省大量精力用于其他方面符合當(dāng)今社會(huì)的商業(yè)形式而且本軟件體積小操作簡(jiǎn)單是管理倉(cāng)庫(kù)的不二選擇系統(tǒng)簡(jiǎn)介:設(shè)計(jì)亮點(diǎn):三級(jí)菜單使操作更簡(jiǎn)便明了密碼操作能有效保證客戶信息的安全性獨(dú)特的dos命令調(diào)用使信息存儲(chǔ)的實(shí)體屬性為隱藏且無(wú)擴(kuò)展名大大增大了安全系數(shù)數(shù)據(jù)結(jié)構(gòu)為鏈表擺脫了數(shù)據(jù)數(shù)量的限制提供三種查看模式并會(huì)標(biāo)出排名退出店主模式時(shí)會(huì)提示是否保存若選擇yes著進(jìn)行保存操作基本功能:在員工模式下可輸入賣出貨物的名稱和數(shù)目程序自動(dòng)在后臺(tái)進(jìn)行一系列的操作新建數(shù)據(jù)并同
2、時(shí)對(duì)其處理修改數(shù)據(jù)插入數(shù)據(jù)刪除數(shù)據(jù)查找數(shù)據(jù)查看數(shù)據(jù)數(shù)據(jù)存檔修改密碼三、系統(tǒng)結(jié)構(gòu)圖I克麓jg用輛仇亦0 抜怕呈:g舌I#define LEN sizeof(struct shop)#include#include#include#include struct shopchar name30;float price_in;float price_out;int num_in;int num_now;int num_sold;float win;float percent;struct shop *next;int n=0;void main(void)void auto1(struct shop
3、*h_p);int menu1(struct shop *h_p);void print1(void);void assistant(struct shop *head);int password(void);int menu2(struct shop *h_p);void print2(void);void creat(struct shop *h_p);void rewrite(struct shop *h_p);void insert(struct shop *h_p);void deleat(struct shop *h_p);void search(struct shop *h_p)
4、;void printall(struct shop *h_p);void save(struct shop *head);void password_set(void);int password_exi(struct shop *h_p); int data_exi(struct shop *h_p); void load(struct shop *h_p); void save(struct shop *head);struct shop *addbuild(struct shop *h_p); void sort0(struct shop *h_p); int search1(struc
5、t shop *h_p,char a30); void sort1(struct shop *h_p); void sort2(struct shop *h_p); void sort3(struct shop *h_p);void print3(void);void password_create(void);struct shop *addbuild(struct shop *h_p); int a;struct shop *head,*h_p; head=NULL; h_p=&head;auto1(h_p);do a=menu1(h_p); while(a!=3); system(cls
6、);printf(” 謝謝使用 A_A);getch();int menu1(struct shop *h_p)int a,b;struct shop *head; head=*h_p;print1();scanf(%d,&a);putchar(n); getchar();doswitch(a)case 1:assistant(head);break;case 2:if(password()do b=menu2(h_p); while(b!=9); break;default:break;if(a!=3) system(cls);print1(); scanf(%d,&a); while(a!
7、=3); return(a);int menu2(struct shop *h_p)int b;char a;struct shop *head; head=*h_p;print2(); scanf(%d,&b); putchar(n); getchar();doswitch(b)case 1:creat(h_p);break;case 2:rewrite(h_p);break;case 3:insert(h_p);break;case 4:deleat(h_p);break;case 5:search(h_p);break;case 6:printall(h_p);break;case 7:
8、head=*h_p;save(head);break;case 8:password_set();break; default:break;if(b!=9) system(cls);print2(); scanf(%d,&b); getchar();while(b!=9);printf(n 保存嗎 ?(y/n):);putchar(n);scanf(%c,&a);if(a=y)head=*h_p;save(head);return(b);void auto1(struct shop *h_p)if(password_exi(h_p) & data_exi(h_p) load(h_p);void
9、 print1(void)system(cls);printf(*nprintf(倉(cāng)庫(kù)管理系統(tǒng)n);printf(*);printf(n); printf(n); printf( n);printf(n); printf(n); printf(n); printf(#*菜單*#|1. 員工模式|#|2. 店主模式|#|3. 退出|#*#n);printf(n 請(qǐng)選擇 (1-3):);void assistant(struct shop *head)char a50,c=y;int b;struct shop *i;i=head;while(c=y)system(cls);printf(n 請(qǐng)輸
10、入賣出的商品名稱 :n);gets(a);putchar(n);printf(n 請(qǐng)輸入賣出的商品數(shù)量 :n); scanf(%d,&b);putchar(n); while(strcmp(i-name,a)!=0&i-next!=NULL) i=i-next;if(i-next!=NULL)i-num_now-=b;i-win=(i-num_in-i-num_now)*(i-price_out-i-price_in); elseprintf(n 此商品不存在或通知店主更新數(shù)據(jù)庫(kù) n);printf(n 繼續(xù)嗎? (y/n):);putchar(n);c=getchar();getchar()
11、;save(head);int password(void)FILE*fp;char a50,b50;int i;system(cls);fp=fopen(c:y_secrea,rb);fscanf(fp,%s,&a); fclose(fp);printf( 請(qǐng)輸入密碼 :n); putchar(n);i=0;dobi=getch();printf(*);i+; while(bi-1!=13&iname,0)=0)f=0;while(f)n+;if(n=1)head=j;f=1;printf(n 請(qǐng)輸入下一種貨物的數(shù)據(jù) .nn); i=addbuild(&head);if(strcmp(i-n
12、ame,0)=0) free(i);f=0;break;j-next=i;j=i; j-next=NULL;*h_p=head;void rewrite(struct shop *h_p)char a30;struct shop *i,*j,*head;head=*h_p;i=head;doprintf(n 請(qǐng)輸入要修改貨物的名稱 :);putchar(n);gets(a);if(n=1&!search1(h_p,a)printf(n 不存在的貨物名稱! n);getch();if(head=NULL) goto end;while(n=1&!search1(h_p,a);while(strc
13、mp(a,i-name)!=0&i-next!=NULL) i=i-next;if(strcmp(a,i-name)=0)printf(n 真的要修改嗎? ?(y/n):);putchar(n);if(getchar()=y)getchar();j=addbuild(h_p);strcpy(i-name,j-name);i-price_in=j-price_in;i-price_out=j-price_out;i-num_in=j-num_in;i-num_now=j-num_now;i-num_sold=j-num_sold;i-win=j-win;i-percent=j-percent;f
14、ree(j);printf(n修改完成 A_Ann);end:;void insert(struct shop *h_p)struct shop *i,*j,*x,*head; head=*h_p;x=addbuild(h_p);i=j=head;while(strcmp(i-name,x-name)next!=NULL) j=i;i=i-next; if(strcmp(i-name,x-name)=0) if(i=head) head=x;else j-next=x; x-next=i;elsei-next=x; x-next=NULL;printf(n 插入完成 A_Ann.);*h_p=
15、head; void deleat(struct shop *h_p)struct shop*i,*j,*head;char a30,b;head=*h_p;do system(cls);printf(n 請(qǐng)輸入你要?jiǎng)h除的貨物的名稱 :n); putchar(n);gets(a);if(n=1&!search1(h_p,a)printf(n 不存在的貨物名稱! n); if(head=NULL) goto end; while(n=1&!search1(h_p,a);printf(n 真的要?jiǎng)h除嗎 ?(y/n):); putchar(n);b=getchar();getchar();if(b=
16、y) i=head;while(strcmp(i-name,a)!=0&i-next!=NULL)j=i;i=i-next;if(strcmp(i-name,a)=0)if(i=head)head=i-next;free(i);elsej-next=i-next;n-;printf(n 刪除完成 A_A.nn);*h_p=head;end:;void search(struct shop *h_p)int begin,end,mid,t;char a30;struct shop *i,*head;head=*h_p;i=head;printf(n 請(qǐng)輸入要查詢貨物的名稱 :);putchar(
17、n);gets(a);while(strcmp(i-name,a)!=0)&i-next!=NULL)i=i-next;if(strcmp(i-name,a)=0)printf(n名稱t進(jìn)價(jià)t售價(jià)t進(jìn)貨數(shù)目存貨數(shù)目 銷量t贏利t利率n);printf(n= =n);printf(%s%10.2f%10.2f%10d%10d%10d%9.2f%10.2f,i-name,i-price_in,i-price_out,i-n um_in,i-num_now,i-num_sold,i-win,i-percent);elseprintf(n 此貨物不存在 !n);getch();void printal
18、l(struct shop *h_p)int a,c;char b=y;struct shop *i;while(b=y)dosystem(cls);print3();scanf(%d,&a);while(a!=1&a!=2&a!=3);switch(a)case 1:sort1(h_p);break;case 2:sort2(h_p);break;case 3:sort3(h_p);break;default:break;for(c=1,i=*h_p;i-next!=NULL;i=i-next,c+)printf(n名稱t進(jìn)價(jià)t售價(jià)t進(jìn)貨數(shù)目存貨數(shù)目銷量t贏利t利率t排名n);printf(
19、n= =n);printf(%s%10.2f%10.2f%10d%10d%10d%9.2f%10.2f%8d,i-name,i-price_in,i-price_out,i-num_in,i-num_now,i-num_sold,i-win,i-percent,c);if(c%8=0)getch();getchar();printf(”按任意鍵繼續(xù)。n);printf(n名稱t進(jìn)價(jià)t售價(jià)t進(jìn)貨數(shù)目存貨數(shù)目銷量t贏利 t利率t排名n);printf(n= =n);printf(%s%10.2f%10.2f%10d%10d%10d%9.2f%10.2f%8d,i-name,i-price_in,i
20、-price_out,i-num_in,i-num_now,i-num_sold,i-win,i-percent,c);getch();getchar();system(cls);printf( 查看其他排列方式? (y/n):);scanf(%c,&b);putchar(n);void save(struct shop *head)FILE *fp;struct shop *i;system(attrib c:y_data -h);system(del c:y_data); fp=fopen(c:y_data,wb+);i=head;for(i=head;i-next!=NULL;i=i-n
21、ext)fprintf(fp,%s%7.2f,%.2f,%d,%d,%d,%.2f,%.2f,i-name,i-price_in,i-price_out,i-num_in ,i-num_now,i-num_sold,i-win,i-percent);fprintf(fp,%s%7.2f,%.2f,%d,%d,%d,%.2f,%.2f,i-name,i-price_in,i-price_out,i-num_in ,i-num_now,i-num_sold,i-win,i-percent);fclose(fp);system(attrib c:y_data +h);printf(nA_A 已保存
22、n);void password_set()FILE *fp;int i,f=0,t=0;char a20,b20;doif(password()dosystem(cls);printf( 請(qǐng)輸入新密碼 (319 位 ):n);putchar(n);i=0;doai=getch();printf(*); i+; while(ai-1!=13&i19); ai-1=0;printf(n 請(qǐng)確認(rèn)新密碼 :n); putchar(n);i=0;do bi=getch(); printf(*);i+; while(bi-1!=13&i2) t=1;system(attrib c:y_secrea -h
23、); system(del c:y_secrea); fp=fopen(c:y_secrea,wb+); fprintf(fp,%s,a);fclose(fp);printf(n密碼修改完成A_An); ; while(t=0); else f+;if(f=3) break; while(t=0);int password_exi(struct shop *h_p)FILE *fp;if(fp=fopen(c:y_secrea,rb)!=NULL) fclose(fp);return 1;else password_create(); creat(h_p); save(*h_p);return
24、 0; int data_exi(struct shop *h_p)FILE *fp;if(fp=fopen(c:y_data,rb)!=NULL) fclose(fp);return 1;elsecreat(h_p);save(*h_p);return 0; void load(struct shop *h_p)FILE *fp;struct shop *head,*i,*j; head=NULL;j=i=(struct shop *)malloc(LEN);if(fp=fopen(c:y_data,rb)!=NULL)while(!feof(fp)fscanf(fp,%s%f,%f,%d,
25、%d,%d,%f,%f,i-name,&i-price_in,&i-price_out,&i-num_in,&i-n um_now,&i-num_sold,&i-win,&i-percent);n+;if(n=1)head=j;if(!feof(fp)i=(struct shop*)malloc(LEN);j-next=i;j=i;j-next=NULL;*h_p=head;fclose(fp); struct shop *addbuild(struct shop *h_p) struct shop *i;int b,f;float c;char a30;i=(struct shop *)ma
26、lloc(LEN);dof=0;printf(n 請(qǐng)輸入名稱 :nn);scanf(%s,a);if(n=1&search1(h_p,a)printf(n 名稱重復(fù)! n);f=1;while(f);strcpy(i-name,a);if(strcmp(i-name,0)=0)return(i);printf( 請(qǐng)輸入進(jìn)價(jià) :nn);scanf(%f,&c); i-price_in=c; printf( 請(qǐng)輸入售價(jià) :nn);scanf(%f,&c); i-price_out=c; printf( 請(qǐng)輸入進(jìn)貨數(shù)目 :nn); scanf(%d,&b); i-num_in=b;printf( 請(qǐng)
27、輸入現(xiàn)存數(shù)目 :nn); scanf(%d,&b); i-num_now=b; i-num_sold=i-num_in-i-num_now; i-win=(i-num_in-i-num_now)*(i-price_out-i-price_in); i-percent=(i-price_out-i-price_in)/(i-price_in); return(i);void sort0(struct shop *h_p)struct shop *i,*j,*z,*sei,*jt,*seit;int ni,nj,np,t;char sm30; if(n=2) for(i=*h_p,ni=1;i-n
28、ext!=NULL;i=i-next,ni+) strcpy(sm,i-name); np=ni;for(j=i-next,nj=ni+1;j-next!=NULL;j=j-next,nj+) if(strcmp(sm,j-name)0)np=nj;strcpy(sm,j-name); if(j-next=NULL) if(strcmp(sm,j-name)0)np=nj; if(np!=ni) for(t=1,j=*h_p;tnext,t+);jt=j-next;i=jt;if(ni=1) seit=*h_p; z=*h_p;*h_p=j-next; j-next=z;else for(t=
29、1,sei=*h_p;tnext,t+);seit=sei-next; z=sei-next; sei-next=j-next; j-next=z; z=jt-next; jt-next=seit-next; seit-next=z;int search1(struct shop *h_p,char a30)struct shop *i;int j; for(i=*h_p,j=1;jnext) if(strcmp(a,i-name)=0) return 1; if(strcmp(a,i-name)=0) return 1;elsereturn 0; void sort1(struct shop
30、 *h_p)struct shop *i,*j,*z,*sei,*jt,*seit; int ni,nj,np,t;int sm;if(n=2) for(i=*h_p,ni=1;i-next!=NULL;i=i-next,ni+) sm=i-num_sold; np=ni;for(j=i-next,nj=ni+1;j-next!=NULL;j=j-next,nj+) if(smnum_sold)np=nj;sm=j-num_sold; if(j-next=NULL) if(smnum_sold)np=nj;if(np!=ni) for(t=1,j=*h_p;tnext,t+);jt=j-nex
31、t;i=jt;if(ni=1)seit=*h_p;z=*h_p;*h_p=j-next;j-next=z;else for(t=1,sei=*h_p;tnext,t+);seit=sei-next;z=sei-next;sei-next=j-next;j-next=z;z=jt-next; jt-next=seit-next; seit-next=z;void sort2(struct shop *h_p)struct shop *i,*j,*z,*sei,*jt,*seit;int ni,nj,np,t;float sm;if(n=2) for(i=*h_p,ni=1;i-next!=NUL
32、L;i=i-next,ni+) sm=i-win; np=ni;for(j=i-next,nj=ni+1;j-next!=NULL;j=j-next,nj+) if(smwin)np=nj;sm=j-win; if(j-next=NULL) if(smwin) np=nj; if(np!=ni) for(t=1,j=*h_p;tnext,t+); jt=j-next;i=jt;if(ni=1)seit=*h_p; z=*h_p; *h_p=j-next; j-next=z;elsefor(t=1,sei=*h_p;tnext,t+); seit=sei-next;z=sei-next;sei-
33、next=j-next;j-next=z;z=jt-next; jt-next=seit-next; seit-next=z;void sort3(struct shop *h_p)struct shop *i,*j,*z,*sei,*jt,*seit;int ni,nj,np,t;float sm;if(n=2) for(i=*h_p,ni=1;i-next!=NULL;i=i-next,ni+) sm=i-percent; np=ni;for(j=i-next,nj=ni+1;j-next!=NULL;j=j-next,nj+) if(smpercent)np=nj; sm=j-percent; if(j-next=NULL) if(smpercent) np=nj;i
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 建筑制圖及識(shí)圖模擬習(xí)題及參考答案
- 《風(fēng)箏》大班教案
- 加工房轉(zhuǎn)讓合同范例
- 江西小學(xué)英語(yǔ)試卷
- 個(gè)人專柜轉(zhuǎn)讓合同范本
- 包裝制品公司合同范本
- 勞務(wù)雇傭標(biāo)準(zhǔn)合同范本
- 《石頭書(shū)》教案六篇
- 叉車師傅勞務(wù)合同范本
- 賣房中介傭金合同范本
- 《家庭教育學(xué)第2版》全套教學(xué)課件
- 2024~2025學(xué)年度八年級(jí)數(shù)學(xué)上冊(cè)第1課時(shí) 負(fù)整數(shù)指數(shù)冪教學(xué)設(shè)計(jì)
- 2024年江西省吉安市遂川縣初中教師業(yè)務(wù)素養(yǎng)檢測(cè)試卷歷史試題
- 2024至2030年中國(guó)特鋼行業(yè)“十四五”分析及發(fā)展前景預(yù)測(cè)研究分析報(bào)告
- 小兒急性腸炎查房課件
- DL∕T 2024-2019 大型調(diào)相機(jī)型式試驗(yàn)導(dǎo)則
- 2024年蘇州市職業(yè)大學(xué)單招職業(yè)適應(yīng)性測(cè)試題庫(kù)附答案
- 術(shù)后惡心嘔吐防治專家意見(jiàn)
- MOOC 醫(yī)學(xué)免疫學(xué)-南昌大學(xué) 中國(guó)大學(xué)慕課答案
- JB-T 8640-2014 額定電壓26-35kV及以下電力電纜附件型號(hào)編制方法
- 社會(huì)保障卡辦理委托書(shū)
評(píng)論
0/150
提交評(píng)論