商場(chǎng)收銀系統(tǒng)_第1頁(yè)
商場(chǎng)收銀系統(tǒng)_第2頁(yè)
商場(chǎng)收銀系統(tǒng)_第3頁(yè)
已閱讀5頁(yè),還剩17頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、課程設(shè)計(jì)課程名稱(chēng)C語(yǔ)言程序設(shè)計(jì)課程設(shè)計(jì) A題目名稱(chēng)商場(chǎng)收銀系統(tǒng)目錄1 系統(tǒng)分析 1.1.1 課程設(shè)計(jì)內(nèi)容 1.1.2 系統(tǒng)功能需求分析 1.1.3 數(shù)據(jù)結(jié)構(gòu)設(shè)計(jì) 錯(cuò). 誤 !未定義書(shū)簽。2 系統(tǒng)設(shè)計(jì) 2.2.1 總體設(shè)計(jì) 2.2.2 詳細(xì)設(shè)計(jì) 界面設(shè)計(jì) 各功能模塊的設(shè)計(jì) 4.3 系統(tǒng)編碼設(shè)計(jì) 5.3.1 main 函數(shù) 5.4 系統(tǒng)運(yùn)行 1.3.5 總結(jié) 1.7.1 系統(tǒng)分析1.1 課程設(shè)計(jì)內(nèi)容 建立一商品信息文件,商品信息包括商品編號(hào)、商品名、商品類(lèi)別、商品數(shù)量、 商品價(jià)格等。建立一商場(chǎng)收銀系統(tǒng),功能包括:1. 系統(tǒng)登錄:運(yùn)行系統(tǒng)時(shí),收銀員應(yīng)輸入姓名(或編號(hào))

2、及密碼,驗(yàn)證后方可 使用系統(tǒng)。2. 收銀操作:收銀員逐條輸入商品編號(hào)及數(shù)量,系統(tǒng)自動(dòng)計(jì)算金額,輸入完畢 后顯示應(yīng)付款,當(dāng)輸入實(shí)收額后,計(jì)算出找贖值。3. 交易完成后按一定格式顯示回單(格式參照一般超市中的打印小票) 。4. 保存所顯示的回單。5. 自動(dòng)按銷(xiāo)售情況更新商品信息文件中的數(shù)據(jù)。6. 查詢(xún)收銀員銷(xiāo)售信息。7. 瀏覽庫(kù)存商品信息。1.2 系統(tǒng)功能需求分析本系統(tǒng)應(yīng)具有以下功能:1、文件操作功能進(jìn)行商品信息管理,以文本的形式保存商品最新信息2、數(shù)據(jù)輸入功能 個(gè)人登錄,消費(fèi)商品基本資料的輸入,銷(xiāo)售信息輸入等3、數(shù)據(jù)添加、修改、刪除功能 商品數(shù)據(jù)更新,個(gè)人入庫(kù)信息修改更新4、計(jì)算功能基本計(jì)算功能

3、,銷(xiāo)售額處理5、查詢(xún)功能資料庫(kù)信息查詢(xún)7、數(shù)據(jù)顯示功能保障客戶(hù)知情權(quán),對(duì)系統(tǒng)輸入輸出信息的顯示2 系統(tǒng)設(shè)計(jì)2.1 總體設(shè)計(jì)按系統(tǒng)分析的功能要求將系統(tǒng)劃分為以下幾個(gè)主要功能模塊:1、建立新文本庫(kù)信息模塊2、銷(xiāo)售系統(tǒng)模塊3、商品銷(xiāo)售信息回單模塊4、商品庫(kù)更新模塊5、銷(xiāo)售回單保存模塊2.2 詳細(xì)設(shè)計(jì)2.2.1 界面設(shè)計(jì)1、菜單設(shè)計(jì)主菜單:子菜單:2、輸入界面的設(shè)計(jì)3、信息顯示界面的設(shè)計(jì)Mo .: ciinouiit: sum:0.00receive; change: 0.00Press any key to exit222各功能模塊的設(shè)計(jì)(這部分應(yīng)介紹各函數(shù)的根據(jù)劃分的功能模塊,定義以下函數(shù)實(shí)現(xiàn)各功

4、能:原型,各功能模塊實(shí)現(xiàn)所用的算法,可用流程圖描述)1、主函數(shù)main()2、charge 函數(shù)、receipt_m 函數(shù)銷(xiāo)售界面7商品信息錄入3、input_s 函數(shù)4、disp函數(shù)3系統(tǒng)編碼設(shè)計(jì)重要的代(這部分將代碼列出,注意,每個(gè)函數(shù)開(kāi)始處要介紹函數(shù)的功能, 碼應(yīng)有注釋?zhuān)a格式按鋸齒式編排)3.1 main 函數(shù)void mai n()/*主函數(shù):密碼登陸與主頁(yè)面顯示使用*/int key,j;int x,i;void openf();void newf();loop1:clrscr();gotoxy(10,4);for(i=0;i<20;i+)printf("# &q

5、uot;);gotoxy(10,16);for(i=0;i<20;i+)printf("# ");gotoxy(16,5);printf("this is the salesperson systemn");gotoxy(16,7);printf("1.please iput your number:n");gotoxy(16,8);scanf("%s",salesperson_num);gotoxy(16,9);printf("2.please input your key;n");go

6、toxy(16,10);scanf("%d",&key);for(j=0;j<3;j+) if(strcmp(salesperson_num,salespersonj.num)=0&&key=salespersonj.key) break;clrscr();printf("tyour number or key is wrongn");printf("tplease land againn");getch();goto loop1;3.2 clrscr 函數(shù)/* 主頁(yè)面顯示代碼,子函數(shù)選擇界面 */ go

7、toxy(16,8);printf("welcome to use the systemn");gotoxy(16,10);printf("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&qu

8、ot;); gotoxy(16,10);printf("3. receipt message"); gotoxy(16,11);printf("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

9、;i+)printf("* "); gotoxy(16,18);printf("please select the menu:"); 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();

10、while(1);3.3 newf 函數(shù)*/*新建庫(kù)信息函數(shù),建立新文檔存儲(chǔ)更新商品信息void newf() void openf();int i,x;clrscr();do clrscr();gotoxy(10,5); for(i=0;i<20;i+) printf("* ");gotoxy(16,8);printf("1.the new warehouse filename n"); gotoxy(16,9);printf("2.add the goods message");gotoxy(16,10);printf(&q

11、uot;3.exit"); gotoxy(10,16); for(i=0;i<20;i+) printf("* "); gotoxy(16,18);printf("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&qu

12、ot;);*/printf("tinput the warehouse filename pleasen"); scanf("%s",xname);fp=fopen("xname","a"); fp1=fopen("b.txt","w");fprintf(fp1,"%dt%d",n,n1); fclose(fp1);fp2=fopen("c.txt","w");fp3=fopen("d.txt",

13、"w");printf("tYou were built the warehouse n"); printf("ntcontinue to add goods message?(y/n)");f=getch();if(f='y')input_s();3.4 charge 函數(shù)/* 銷(xiāo)售信息管理系統(tǒng) */charge()int i,j,f;int No;float sum=0;float change,receive;clrscr();gotoxy(10,5);for(i=0;i<20;i+)printf(&quo

14、t;* ");fp1=fopen("b.txt","r"); fscanf(fp1,"%d%d",&n,&n1);fclose(fp1);if( fp=fopen("a.txt","r")!=NULL) for(i=0;i<n;i+) fscanf(fp,"%d%s%d%d",&goodsi.num,,&goodsi.price,&goodsi.amount);doprintf("ntNo

15、.:t");scanf("%d",&No);printf("ntamount:t");scanf("%d",&j);No-;n1+;goodsNo.amount-;sum+=j*goodsNo.price;fp2=fopen("c.txt","a");fprintf(fp2,"%st%dt%st%dt%dn",salesperson_num,goodsNo.num,goodsN,goodsN o.price,j);fclose(fp2);

16、fp3=fopen("d.txt","a");fprintf(fp3,"%dnt%d",goodsNo.num,j);fclose(fp3);f=getch();if(f=0)getch();break;while(1);printf("ntsum:t%5.2f",sum);printf("nntreceive:t");scanf("%f",&receive);change=receive-sum;printf("ntchange:t%5.2f",

17、change);fp3=fopen("d.txt","a");fprintf(fp3,"nt%5.2fnt%5.2fnt%5.2f",sum,receive,change);fclose(fp3);fp=fopen("a.txt","w");for(i=0;i<n;i+) fprintf(fp,"%dt%st%dt%dn",goodsi.num,,goodsi.price,goodsi.amount); fclose(fp);fp1=fopen(&

18、quot;b.txt","w");fprintf(fp1,"%dt%d",n,n1);fclose(fp1);gotoxy(10,20);for(i=0;i<20;i+)printf("* ");gotoxy(16,22);printf("Press any key to exit");getch();3.5 receipt 函數(shù)/* 客戶(hù)回單信息 */receipt_m()int i,No,j;float change,receive,sum;clrscr();gotoxy(10,5);for(i

19、=0;i<20;i+)printf("* ");fp1=fopen("b.txt","r");fscanf(fp1,"%d%d",&n,&n1);fclose(fp1);if( fp3=fopen("d.txt","r")!=NULL) for(i=0;i<n1;i+) fscanf(fp3,"%dt%dt%ft%ft%f",&goodsNo.num,&j,&sum,&receive,&c

20、hange); for(i=0;i<n1;i+)printf("ntNo:t%dntamount:t%dntsum:t%5.2fntreceive:%5.2fntchange:t%5.2fn",goods No.num,j,sum,receive,change);fclose(fp3);elseprintf("errorn");gotoxy(10,20);for(i=0;i<20;i+)printf("* ");gotoxy(16,22);printf("Press any key to exit");

21、getch();3.6 input 函數(shù)/* 庫(kù)存信息更新 */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");fp1=fopen("b.txt","r");fscanf(fp1,"%d%d",&n,&n1);fp=fopen("a.txt","

22、;a");for(i=0;i+,j+) scanf("%d%s%d%d",&goodsi.num,,&goodsi.price,&goodsi.amount); n+;fp1=fopen("b.txt","w");fprintf(fp1,"%dt%d",n,n1);fclose(fp1);printf("ncontinue?(y/n)");f=getch();if(f='n')break;for(i=0;i<=j;i+

23、)fprintf(fp,"%dt%st%dt%dn",goodsi.num,,goodsi.price,goodsi.amount); fclose(fp);gotoxy(16,20);printf("press any key to break");getch();3.7 sell 函數(shù)/* 顯示最近銷(xiāo)售信息 */ sell_m() int i,j,No;clrscr();gotoxy(10,5);for(i=0;i<20;i+)printf("* ");printf("ntsalesperso

24、n_numtnumtnametpricetsell_numn");fp1=fopen("b.txt","r");fscanf(fp1,"%d%d",&n,&n1);fclose(fp1);if( fp2=fopen("c.txt","r")!=NULL) for(i=0;i<n1;i+)fscanf(fp2,"%st%dt%st%dt%dn",salesperson_num,&goodsNo.num,goodsN,&

25、goods No.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(i=0;i<20;i+)printf("* ");gotoxy(16,22);printf("Press any key to exit");getch()

26、;3.8 display 函數(shù)/* 顯示最近銷(xiāo)售的庫(kù)存信息 */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("b.txt","r");fscanf(fp1,&

27、quot;%d",&n);if( fp=fopen(xname,"r")!=NULL) for(i=0;i<n;i+)fscanf(fp,"%d%s%d%d",&goodsi.num,,&goodsi.price,&goodsi.amount); for(i=0;i<n;i+) printf("t%dt%st%dt%dn",goodsi.num,,goodsi.price,goodsi.amount); fclose(fp);elseprintf("errorn");gotoxy(10,20);for(i=0;i<20;i+)printf("* ");gotoxy(16,22);printf("Press any key to exit");getch();4 系統(tǒng)運(yùn)行(這部分介紹程序運(yùn)行過(guò)程, 系統(tǒng)操作使用的說(shuō)明, 使用測(cè)試數(shù)據(jù)運(yùn)行的結(jié)果,可將運(yùn)行結(jié)果截圖進(jìn)行說(shuō)明)密碼登陸界面菜單頁(yè)面銷(xiāo)售系統(tǒng)顯示界面銷(xiāo)售記錄商品信息添加26740Ion.dll 174732352

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論