公司銷售管理系統(tǒng)課程設(shè)計_第1頁
公司銷售管理系統(tǒng)課程設(shè)計_第2頁
公司銷售管理系統(tǒng)課程設(shè)計_第3頁
公司銷售管理系統(tǒng)課程設(shè)計_第4頁
已閱讀5頁,還剩43頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、課程設(shè)計報告(2014- 2015年度第 2 學(xué)期 )實驗名稱:數(shù)據(jù)結(jié)構(gòu)與算法題目:公司銷售管理系統(tǒng)院系:控制與計算機(jī)工程班級:信安 1401 班學(xué)號:1141290114姓名:劉建興指導(dǎo)教師:林碧英設(shè)計周數(shù):1 周成績:日期:2015年 7月 5 日課程設(shè)計報告一、課程設(shè)計的目的與要求1 目的 :應(yīng)用數(shù)據(jù)結(jié)構(gòu)和算法來設(shè)計相應(yīng)的程序,培養(yǎng)學(xué)生問題求解模塊的框架設(shè)計和詳細(xì)設(shè)計、相關(guān)程序?qū)崿F(xiàn)和調(diào)試能力,完成創(chuàng)新能力和實踐能力的訓(xùn)練。2 要求 :用高級程序設(shè)計語言C 編碼,用VC+開發(fā)平臺調(diào)試二、設(shè)計正文(一) 課程設(shè)計題目公司銷售管理系統(tǒng)(二)需求分析1、功能分析實現(xiàn)對客戶信息的管理:包括對客戶的

2、基本信息進(jìn)行添加、修改、刪除、查詢、顯示。實現(xiàn)產(chǎn)品信息管理:包括對產(chǎn)品的基本信息進(jìn)行添加、修改、刪除、查詢、顯示。實現(xiàn)供應(yīng)商信息管理:包括對供應(yīng)商的基本信息進(jìn)行添加、修改、刪除、查詢、顯示。實現(xiàn)定單信息管理:包括對定單的基本信息進(jìn)行添加、修改、刪除、查詢、顯示。2、數(shù)據(jù)分析除商品價格采用float 型,商品數(shù)量、編號及年齡采用int 型,鏈表結(jié)點采用結(jié)構(gòu)體類型外,其余數(shù)據(jù)類型均為字符串型數(shù)據(jù)。另,采用線性鏈表對數(shù)據(jù)進(jìn)行存儲;3、需要用文件保存的數(shù)據(jù)客戶信息、產(chǎn)品信息、供應(yīng)商信息。(三) 概要設(shè)計函數(shù) init1 、init2 、init3 、init4 的功能是從本地的 txt 文檔中分別讀取

3、客戶信息, 商品信息和供應(yīng)商信息,完成初始化操作。函數(shù) creat1、creat2、creat3、creat4 的功能是完成分別對客戶信息,商品信息、供應(yīng)商信息以及訂單信息的添加操作。函數(shù) del1、del2、del3、del4 的功能是完成分別對分別客戶信息,商品信息、供應(yīng)商信息以及訂單信息的刪除操作。函數(shù) revise1、revise2、revise3 、revise4 的功能是完成分別對客戶信息,商品信息、供應(yīng)商信息以及訂單信息的修改操作。函數(shù) find1 、find2 、 find 3 、find4 的功能是完成分別對客戶信息,商品信息、供應(yīng)商信息以及訂單信息的查詢操作。函數(shù) look

4、1 、look2 、 look3 、 look4 的功能是完成分別對客戶信息,商品信息、供應(yīng)商信息以及訂單信息的瀏覽操作。order 函數(shù)的功能是完成對訂單信息的排序作用。menu 函數(shù)的功能是增加系統(tǒng)界面的美觀性以及功能的多次調(diào)用。wait 函數(shù)的功能是為用戶瀏覽信息預(yù)留充分時間。1課程設(shè)計報告(四) 詳細(xì)設(shè)計1、系統(tǒng)功能結(jié)構(gòu)框圖公司銷售管理系統(tǒng)客戶信息管理產(chǎn)品信息管理供應(yīng)商信息管理訂單信息管理添修刪查添修刪查添修刪查添修刪查加改除詢加改除詢加改除詢加改除詢2、數(shù)據(jù)類型定義typedef struct guest/ 客戶信息管理系統(tǒng)char name30;int age;char gende

5、r15;char tel30;guest;typedef struct guest1guest data;guest1 *next;guest1,*link1;typedef struct goods/產(chǎn)品信息管理系統(tǒng)2課程設(shè)計報告char name30;char side20;char add40;float price;char birth30;goods;typedef struct goods1goods data;goods1 *next;goods1,*link2;typedef struct supply/供應(yīng)商信息管理char name30;char add40;char te

6、l30;supply;typedef struct supply1supply data;supply1 *next;supply1,*link3;typedef struct sheet/訂單信息管理link1 p1;link2 q1;link3 r1;float price;3課程設(shè)計報告int sum;int num;sheet;typedef struct sheet1sheet data;sheet1 *next;sheet1,*link4;3、基本操作init1(link1 &T):T為第一個鏈表的頭指針。init2(link2 &T):T為第二個鏈表的頭指針。in

7、it3(link3 &T):T為第三個鏈表的頭指針。init4(link4 &T):T為第四個鏈表的頭指針。creat1(link1 T):T為第一個鏈表的頭指針。creat2(link2 T):T為第二個鏈表的頭指針。creat3(link3 T):T為第三個鏈表的頭指針。creat4(link4 T,link1 T1,link2 T2,link3 T3):T為第四個鏈表的頭指針,T1,T2,T3 分別為第一,二,三個鏈表的頭指針。del1(link1 T):T為第一個鏈表的頭指針。del2(link2 T):T為第二個鏈表的頭指針。del3(link3 T):T為第三個鏈表

8、的頭指針。del4(link4 T):T為第四個鏈表的頭指針。find1(link1 T):T為第一個鏈表的頭指針。find2(link2 T):T為第二個鏈表的頭指針。find3(link3 T):T為第三個鏈表的頭指針。find4(link4 T):T為第四個鏈表的頭指針。order(link4 T): T為第四個鏈表的頭指針。(五) 測試結(jié)果4課程設(shè)計報告5課程設(shè)計報告6課程設(shè)計報告三、課程設(shè)計總結(jié)或結(jié)論1 完成的工作實現(xiàn)了對客戶信息的管理:包括對客戶的基本信息進(jìn)行添加、修改、刪除、查詢、顯示。實現(xiàn)了產(chǎn)品信息管理:包括對產(chǎn)品的基本信息進(jìn)行添加、修改、刪除、查詢、顯示。實現(xiàn)了供應(yīng)商信息管理

9、:包括對供應(yīng)商的基本信息進(jìn)行添加、修改、刪除、查詢、顯示。實現(xiàn)了定單信息管理:包括對定單的基本信息進(jìn)行添加、修改、刪除、查詢、顯示。2 未完成的工作界面不夠美觀。3. 所需做的改進(jìn)繼續(xù)美化界面。四、參考文獻(xiàn)1 林碧英 1,新編數(shù)據(jù)結(jié)構(gòu)及算法編程 . 清華大學(xué)出版社 , 2012 年 9 月第一版附錄(程序)#include <stdio.h>#include <stdlib.h>#include <string.h>7課程設(shè)計報告#include <conio.h>#include <process.h>typedef struct

10、guest/客戶信息管理系統(tǒng)char name30;int age;char gender15;char tel30;guest;typedef struct guest1guest data;guest1 *next;guest1,*link1;void init1(link1 &T)link1 p,s;FILE *fp;T=s=new guest1;T->next=NULL;if(fp=fopen("1.txt","r")=NULL)printf("error!");exit(1);while(!feof(fp)8課

11、程設(shè)計報告p=new guest1;fscanf(fp,"%st%st%dt%st",p->,p->data.gender,&p->data.age,p->data.tel);p->next=NULL;s->next=p;s=p;if(fclose(fp)printf("Can't close the file!n");exit(1);void creat1(link1 T)link1 p,s;FILE *fp;int yn;s=T;while(s->next!=NULL)s=s

12、->next;dop=new guest1;printf("請輸入客戶姓名:");scanf("%s",p->);printf("請輸入客戶性別:");scanf("%s",p->data.gender);printf("請輸入客戶年齡:");9課程設(shè)計報告scanf("%d",&p->data.age);printf("請輸入客戶聯(lián)系方式:");scanf("%s",p->dat

13、a.tel);p->next=NULL;s->next=p;s=p;if(fp=fopen("1.txt","at")=NULL)printf("error!");exit(0);fprintf(fp,"n%st%st%dt%s",p->,p->data.gender,p->data.age,p->data.tel);if(fclose(fp)printf("Can't close the file!n");exit(0);print

14、f("添加成功! n");printf("是否繼續(xù)添加?(輸入0 或 1): ");scanf("%d",&yn);while(yn);void look1(link1 T)link1 p;p=T->next;printf("%-12s%-12s%-12s%-12sn","姓名 "," 性別 "," 年齡 ","聯(lián)系方式 ");printf("-n");while(p!=NULL)printf(&quo

15、t;%-12s",p->);10課程設(shè)計報告printf("%-12s",p->data.gender);printf("%-12d",p->data.age);printf("%-12s",p->data.tel);printf("n-n");p=p->next;int revise1(link1 T)link1 p;FILE *fp;char xiu25;int n;printf("請輸入修改客戶姓名:");scanf("%

16、s",xiu);p=T->next;while(p!=NULL&&strcmp(p->,xiu)!=0)p=p->next;if(p=NULL)printf("并無此人! n");return 0;printf("1.姓名 2. 性別 3. 年齡 4. 聯(lián)系方式 n");doprintf("請選擇修改項:");scanf("%d",&n);switch(n)case 1:printf("請輸入新的姓名:");scanf(&qu

17、ot;%s",p->);11課程設(shè)計報告break;case 2:printf("請輸入新的性別:");scanf("%s",p->data.gender);break;case 3:printf("請輸入新的年齡:");scanf("%d",&p->data.age);break;case 4:printf("請輸入新的聯(lián)系方式:");scanf("%s",p->data.tel);break;printf(&qu

18、ot;是否繼續(xù)( 0 或 1)? ");scanf("%d",&n);while(n);p=T->next;if(fp=fopen("1.txt","w")=NULL)printf("error!");exit(0);fprintf(fp,"%st%st%dt%s",p->,p->data.gender,p->data.age,p->data.tel);if(fclose(fp)printf("Can't clo

19、se the file!n");exit(0);p=p->next;while(p!=NULL)if(fp=fopen("1.txt","at")=NULL)12課程設(shè)計報告printf("error!");exit(0);fprintf(fp,"n%st%st%dt%s",p->,p->data.gender,p->data.age,p->data.tel);if(fclose(fp)printf("Can't close the fil

20、e!n");exit(0);p=p->next;printf("修改成功!n");return 1;int del1(link1 T)link1 p,q;FILE *fp;char xiu25;printf("請輸入需刪除客戶姓名:");scanf("%s",xiu);p=T;while(p->next!=NULL&&strcmp(p->next->,xiu)!=0)p=p->next;if(p->next=NULL)printf("并無此人!

21、n");return 0;q=p->next;p->next=q->next;13課程設(shè)計報告delete(q);p=T->next;if(fp=fopen("1.txt","w")=NULL)printf("error!");exit(0);fprintf(fp,"%st%st%dt%s",p->,p->data.gender,p->data.age,p->data.tel);if(fclose(fp)printf("Can&#

22、39;t close the file!n");exit(0);p=p->next;while(p!=NULL)if(fp=fopen("1.txt","at")=NULL)printf("error!");exit(0);fprintf(fp,"n%st%st%dt%s",p->,p->data.gender,p->data.age,p->data.tel);if(fclose(fp)printf("Can't close the fil

23、e!n");exit(0);p=p->next;printf("刪除成功!n");return 1;14課程設(shè)計報告int find1(link1 T)link1 p;char xiu25;printf("請輸入查找客戶姓名:");scanf("%s",xiu);p=T->next;while(p!=NULL&&strcmp(p->,xiu)!=0)p=p->next;if(p=NULL)printf("并無此人! n");return 0;els

24、eprintf("查詢信息如下:n");printf("%-12s%-12s%-12s%-12sn","姓名 "," 性別 ","年齡 ","聯(lián)系方式 ");printf("-n");printf("%-12s",p->);printf("%-12s",p->data.gender);printf("%-12d",p->data.age);printf(&quo

25、t;%-12s",p->data.tel);printf("n-n");return 1;typedef struct goods/產(chǎn)品信息管理系統(tǒng)char name30;15課程設(shè)計報告char side20;char add40;float price;char birth30;goods;typedef struct goods1goods data;goods1 *next;goods1,*link2;void creat2(link2 T)link2 p,s;FILE *fp;int yn;s=T;while(s->next!=NULL)s=

26、s->next;dop=new goods1;printf("請輸入產(chǎn)品名:");scanf("%s",p->);printf("請輸入產(chǎn)品價格:");scanf("%f",&p->data.price);printf("請輸入產(chǎn)地:");scanf("%s",p->data.add);printf("請輸入生產(chǎn)日期:");16課程設(shè)計報告scanf("%s",&p->da

27、ta.birth);printf("請輸入保質(zhì)期:");scanf("%s",p->data.side);p->next=NULL;s->next=p;s=p;if(fp=fopen("2.txt","at")=NULL)printf("error!");exit(0);fprintf(fp,"n%st%.2ft%st%st%s",p->,&p->data.price,p->data.add,p->data.

28、birth,p->data.side);if(fclose(fp)printf("Can't close the file!n");exit(0);printf("添加成功! n");printf("是否繼續(xù)( 0 或 1)? ");scanf("%d",&yn);while(yn);void init2(link2 &T)link2 p,s;FILE *fp;T=s=new goods1;T->next=NULL;if(fp=fopen("2.txt",&q

29、uot;r")=NULL)17課程設(shè)計報告printf("error!");exit(1);while(!feof(fp)p=new goods1;fscanf(fp,"%st%ft%st%st%st",p->,&p->data.price,p->data.add,p->data.birth,p->data.side);p->next=NULL;s->next=p;s=p;if(fclose(fp)printf("Can't close the file!n&

30、quot;);exit(1);void look2(link2 T)link2 p;p=T->next;printf("%-18s%-18s%-18s%-18s%-18sn","產(chǎn)品名 "," 產(chǎn)品價格 "," 產(chǎn)地 ","生產(chǎn)日期 ","保質(zhì)期 ");printf("-n");while(p!=NULL)printf("%-18s",p->);printf("%-18.2f",p-&g

31、t;data.price);18課程設(shè)計報告printf("%-18s",p->data.add);printf("%-18s",p->data.birth);printf("%-18s",p->data.side);printf("n-n");p=p->next;int revise2(link2 T)link2 p;FILE *fp;char xiu25;int n;printf("請輸入修改產(chǎn)品名:");scanf("%s",xiu);p=T-&

32、gt;next;while(p!=NULL&&strcmp(p->,xiu)!=0)p=p->next;if(p=NULL)printf("并無此產(chǎn)品 !n");return 0;printf("1.產(chǎn)品名2. 產(chǎn)品價格3. 產(chǎn)地 4. 生產(chǎn)日期5. 保質(zhì)期 n");doprintf("請選擇修改項:");scanf("%d",&n);switch(n)19課程設(shè)計報告case 1:printf("請輸入新的產(chǎn)品名:");scanf(&quo

33、t;%s",p->);break;case 2:printf("請輸入新的產(chǎn)品價格:");scanf("%f",&p->data.price);break;case 3:printf("請輸入新的產(chǎn)地:");scanf("%s",p->data.add);break;case 4:printf("請輸入新的生產(chǎn)日期:");scanf("%d",&p->data.birth);break;case 5:prin

34、tf("請輸入新的保質(zhì)期:");scanf("%s",p->data.side);break;printf("是否繼續(xù)( 0 或 1)? ");scanf("%d",&n);while(n);p=T->next;if(fp=fopen("2.txt","w")=NULL)printf("error!");exit(0);fprintf(fp,"%st%.2ft%st%st%s",p->,p-&

35、gt;data.price,p->data.add,p->data.birth,p->data.side);if(fclose(fp)printf("Can't close the file!n");20課程設(shè)計報告exit(0);p=p->next;while(p!=NULL)if(fp=fopen("2.txt","at")=NULL)printf("error!");exit(0);fprintf(fp,"%st%.2ft%st%st%s",p->da

36、,p->data.price,p->data.add,p->data.birth,p->data.side);if(fclose(fp)printf("Can't close the file!n");exit(0);p=p->next;printf("修改成功!n");return 1;int del2(link2 T)link2 p,q;FILE *fp;char xiu25;printf("請輸入需刪除產(chǎn)品名:");scanf("%s",xiu);p=T;w

37、hile(p->next!=NULL&&strcmp(p->next->,xiu)!=0)21課程設(shè)計報告p=p->next;if(p->next=NULL)printf("并無此產(chǎn)品!n");return 0;q=p->next;p->next=q->next;delete(q);p=T->next;if(fp=fopen("2.txt","w")=NULL)printf("error!");exit(0);fprintf(f

38、p,"%st%.2ft%st%st%s",p->,p->data.price,p->data.add,p->data.birth,p->data.side);if(fclose(fp)printf("Can't close the file!n");exit(0);p=p->next;while(p!=NULL)if(fp=fopen("2.txt","at")=NULL)printf("error!");exit(0);22課程設(shè)計

39、報告fprintf(fp,"%st%.2ft%st%st%s",p->,p->data.price,p->data.add,p->data.birth,p->data.side);if(fclose(fp)printf("Can't close the file!n");exit(0);p=p->next;printf("刪除成功!n");return 1;int find2(link2 T)link2 p;char xiu25;printf("請輸入查找產(chǎn)品名:

40、");scanf("%s",xiu);p=T->next;while(p!=NULL&&strcmp(p->,xiu)!=0)p=p->next;if(p=NULL)printf("并無此產(chǎn)品!n");return 0;elseprintf("查詢信息如下:n");printf("%-12s%-12s%-12s%-12s%-12sn","產(chǎn)品名 ","產(chǎn)品價格 ","產(chǎn)地 ","生產(chǎn)日

41、期 "," 保質(zhì)期 ");printf("-n");23課程設(shè)計報告printf("%-12s",p->);printf("%-12.2f",p->data.price);printf("%-12s",p->data.add);printf("%-12s",p->data.birth);printf("%-12s",p->data.side);printf("n-n");retu

42、rn 1;typedef struct supply/供應(yīng)商信息管理char name30;char add40;char tel30;supply;typedef struct supply1supply data;supply1 *next;supply1,*link3;void init3(link3 &T)link3 p,s;FILE *fp;T=s=new supply1;T->next=NULL;if(fp=fopen("3.txt","r")=NULL)printf("error!");exit(1);24

43、課程設(shè)計報告while(!feof(fp)p=new supply1;fscanf(fp,"%st%st%st",p->,&p->data.add,p->data.tel);p->next=NULL;s->next=p;s=p;if(fclose(fp)printf("Can't close the file!n");exit(1);void creat3(link3 T)link3 p,s;FILE *fp;int yn;s=T;while(s->next!=NULL)s=s->

44、;next;dop=new supply1;printf("請輸入供應(yīng)商名:");scanf("%s",p->);printf("請輸入所在地:");25課程設(shè)計報告scanf("%s",p->data.add);printf("請輸入客戶聯(lián)系方式:");scanf("%s",p->data.tel);p->next=NULL;s->next=p;s=p;if(fp=fopen("3.txt","a

45、t")=NULL)printf("error!");exit(0);fprintf(fp,"n%st%st%s",p->,p->data.add,p->data.tel);if(fclose(fp)printf("Can't close the file!n");exit(0);printf("是否繼續(xù)( 0 或 1)? ");scanf("%d",&yn);while(yn);printf("添加成功!n");v

46、oid look3(link3 T)link3 p;p=T->next;printf("%-28s%-18s%-18s%n","供應(yīng)商 "," 所在地 ","聯(lián)系方式 ");printf("-n");while(p!=NULL)printf("%-28s",p->);26課程設(shè)計報告printf("%-18s",p->data.add);printf("%-18s",p->data.tel);p

47、rintf("n-n");p=p->next;int revise3(link3 T)link3 p;FILE *fp;char xiu25;int n;printf("請輸入修改供應(yīng)商名:");scanf("%s",xiu);p=T->next;while(p!=NULL&&strcmp(p->,xiu)!=0)p=p->next;if(p=NULL)printf("并無此供應(yīng)商!n");return 0;printf("1.姓名 2. 所在地3. 聯(lián)系方式 n");doprintf("請選擇修改項:");scanf("%d",&n);switch(n)case 1:printf("請輸入新供應(yīng)商名:");scanf("%s",p->);break;27課程設(shè)計報告case 2:printf("請輸入新的所在地:");scanf("%s&quo

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論