版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、西安郵電學(xué)院軟體設(shè)計(jì)報(bào)告題目院系名稱:專業(yè)名稱:班 級(jí):學(xué)生姓名:學(xué)號(hào)(8 位) : 05114016指導(dǎo)教師:設(shè)計(jì)起止時(shí)間:1512年04月12日1512年04月19日一. 設(shè)計(jì)目的隨著近年來(lái)我國(guó)經(jīng)濟(jì)的發(fā)展,國(guó)民生活水平的提高,國(guó)內(nèi)的汽車產(chǎn)業(yè)開始迅猛 發(fā)展,人民群眾對(duì)于各種汽車的需求也是日益增多,也因此產(chǎn)生了很多汽車銷 售公司。在這些汽車銷售公司你,他們都沒(méi)有一套好的銷售模式。因此,制作 一套汽車銷售管理系統(tǒng)有助于公司對(duì)汽車的管理、銷售、提高利潤(rùn),并且方便 了客戶查看汽車的信息、購(gòu)買汽車,也更加了解各種汽車的性能和使用性。選 擇適合自己的汽車。二. 設(shè)計(jì)內(nèi)容第一步:需求分析 主要任務(wù)就是通過(guò)
2、詳細(xì)調(diào)查現(xiàn)實(shí)世界要處理的對(duì)象,明確用 戶的各種需求,然后在此基礎(chǔ)上確定新系統(tǒng)的功能。在我設(shè)計(jì)的這個(gè)系統(tǒng)主要 是調(diào)查客戶對(duì)汽車的需求情況,客戶想了解汽車的哪些信息,有哪些要求等等。 第二步:概念結(jié)構(gòu)設(shè)計(jì) 主要就是將需求分析階段得到的用戶需求抽象為信息世 界的結(jié)構(gòu)才能更好的用數(shù)據(jù)庫(kù)管理系統(tǒng)來(lái)實(shí)現(xiàn)這些需求。第三步:對(duì)汽車銷售管理系統(tǒng)進(jìn)行管理和維護(hù)。三. 概要設(shè)計(jì)1功能模塊圖;功能模塊圖:主菜單2.1)銷2)3)4)氏產(chǎn)1口ft仲銷的輸能3:s刪添各個(gè)模銷u售 :銷 作-pu資:):資讀v數(shù)料id 據(jù)。5)輸入銷售數(shù)據(jù)函數(shù)void input3()詢按序井然有序地按照事先安排的進(jìn)形象,歡迎用戶使用本程
3、序。 之后的程序運(yùn)行提供了數(shù)據(jù)基礎(chǔ)。 數(shù)據(jù),和數(shù)字?jǐn)?shù)據(jù)有所不同,是記,有關(guān)于銷售的資料。6) 刪除銷售數(shù)據(jù)函數(shù)void Delete():在取消本次銷售或者本次銷售出現(xiàn)任何問(wèn) 題時(shí)使用,可以對(duì)數(shù)據(jù)進(jìn)行清除,在編輯數(shù)據(jù)時(shí)使用。7) 插入銷售數(shù)據(jù)函數(shù)void insert():對(duì)于一名銷售員來(lái)說(shuō)有可能一次完成多次銷 售,此時(shí)用插入數(shù)據(jù)函數(shù)可以將幾次銷售記錄在一起,在編輯數(shù)據(jù)時(shí)使用。8) 修改銷售數(shù)據(jù)函數(shù)void modify():管理數(shù)據(jù)時(shí)對(duì)數(shù)據(jù)可以進(jìn)行任何修改,在 編輯資料時(shí)使用。9) 計(jì)算銷售總額和每種產(chǎn)品的銷售額void calculat():便于日后對(duì)銷售額和利潤(rùn)進(jìn)行計(jì)算。10) 根據(jù)銷售
4、員編號(hào)來(lái)查詢資料void search_sallD():便于日后對(duì)銷售員根據(jù)業(yè)績(jī)進(jìn)行考核。11對(duì)銷售數(shù)據(jù)進(jìn)行排序void sort():有利于客戶在選車時(shí)直觀的了解汽車的銷 售資料。四詳細(xì)設(shè)計(jì)1.功能函數(shù)的調(diào)用關(guān)系圖函數(shù)名函數(shù)原型功能返回值說(shuō)明fcloseint fclose(FILE *fp)關(guān)閉fp所指的文 件,釋放文件緩沖 區(qū)。有錯(cuò)則返回非0,否則返回0feofint feof(FILE *fp)檢查檔是否結(jié)束,遇文件結(jié)束符返 回非零值,否則返 回0。fope nFILE*ope n( char*file name,char mode)以mode指定的方 式打開名為file name 的
5、檔成功,返回一個(gè)文 件指針(文件信息 區(qū)的起始地址), 否則返回0。freadintfread(char*pt,u nsig nedsize, un signed n ,FILE *fp);從fp所指定的檔1中讀取長(zhǎng)度為size 的n個(gè)數(shù)據(jù)項(xiàng),存 至U pt所指定向的 內(nèi)存區(qū)返回所讀的數(shù)據(jù) 項(xiàng)個(gè)數(shù),如遇文件 結(jié)束或出錯(cuò)返回0fwriteintfwirte(char*ptr,u nsig nedsizeun sig ned n, FILE *fp);把ptr所指向的n*size個(gè)字節(jié)輸出至U fp所指向的檔 中寫到fp文件中的數(shù)據(jù)項(xiàng)的個(gè)數(shù)getcharint getchar(void);從標(biāo)準(zhǔn)輸
6、入設(shè)備 讀取下一個(gè)字符。讀字符。若文件結(jié) 束或出錯(cuò),則返回-1printfintprin tf(char*format,args,)按format指向的格式字符串規(guī)定的 格式,將輸出表列輸出字符的個(gè)數(shù)。若出錯(cuò),返回負(fù)數(shù)Format字符串, 或字符args的值輸出到標(biāo) 準(zhǔn)輸出設(shè)備。數(shù)組起始地址scanfintsca nf(char*format,args,);從標(biāo)準(zhǔn)的輸入設(shè) 備按format指向的 格式字符串所規(guī) 定的格式,輸入數(shù) 據(jù)給args所指向的 單元讀入并賦給 args 的數(shù)據(jù)個(gè)數(shù)。遇文 件結(jié)束返回EOF,出錯(cuò)返回0Args 為指針strcmpintstrcmp(char*str1,ch
7、ar *str2);比較兩個(gè)字符串str1,str2str1<str2,返 回 負(fù) 數(shù);str1=str2 返回 0;str1>str2,返 回 正 數(shù)包含檔stri ng.hstrcpychar*strcpy(char*str1,char*str2);把str2指向的字符串復(fù)制str1到去返回str1包含檔stri ng.hstrle nunsigned int strlen(char*str);統(tǒng)計(jì)字符串中 str 中字符的個(gè)數(shù)(不 包括終止符0')返回字符個(gè)數(shù)包含檔stri ng.h2 各功能函數(shù)的數(shù)據(jù)流程圖;3.重點(diǎn)設(shè)計(jì)及編碼。五測(cè)試資料及運(yùn)行結(jié)果1.正常測(cè)試數(shù)據(jù)(
8、3組)及運(yùn)行結(jié)果;2 非正常測(cè)試數(shù)據(jù)(2組)及運(yùn)行結(jié)果。 六調(diào)試情況,設(shè)計(jì)技巧及體會(huì)1.對(duì)自己的設(shè)計(jì)進(jìn)行評(píng)價(jià),指出合理和不足之處,提出改進(jìn)方案;2 對(duì)設(shè)計(jì)及調(diào)試過(guò)程的心得體會(huì)。七參考文獻(xiàn)八附錄:源代碼#i nclude<stdio.h>#i nclude<stri ng.h>#in clude<c oni o.h>struct salma n char ID15;char n ame15;sal20;struct car char ID15;int price;car20; struct salesdata int year;int month;int da
9、y;int soldnum;struct car car;struct salman salman;struct car all; sada20; void welcome() printf("tt#n" ); printf("tt #1-Input the data #n" );printf("tt #2-Edit data#n" );printf( "tt #3-Browse the data #n" );printf("tt #4-Calculat#n" );printf( "t
10、t #5-Sort#n" );printf( "tt #6-Search#n" );printf("tt # 7-Exit the system #n" ); printf("tt#n" ); void save( ) FILE *fp;int i;char all15,x;printf("nDo you want to save the data?n"); printf("Please input: 'Y' or 'N'n");x=getch();pr
11、intf("Your choice: %cn" ,x); if(x!='n'&&x!= 'N'&&x!= 'y'&&x!= 'Y') printf( "Wrong!choose again!n");x=getch();printf("Your choice: %cn" ,x);if(x= 'n'|x= 'N') getch(); return; if(x= 'y'|x=
12、9;Y')printf("please input the name of the file!n)" scanf("%s",all);if(fp=fopen(all,"wb" )=NULL)printf( "can not open filen" ); return;else for(i=0;i<15;i+)fwrite(&sadai,sizeof(struct salman),1,fp); printf("*save succeed*n" ); fclose(fp);re
13、turn;void input() int m;void input1();void input2();void input3();printf("which data do you want to input?n");printf("1-personn" );printf("2-carn" );printf("3-datan" );printf("4-back to welcomen");printf("Your choose:");scanf("%d"
14、 ,&m);switch(m) case1: input1(); break;case2: input2(); break;case3: input3(); break;case4: welcome(); break;default : printf("Error!n" );void input1() FILE *fp1;int i,m;printf("How many persons do you want to input?n)"printf("The amount is:");scanf("%d" ,
15、&m);for(i=0;i<m;i+) printf( "The basic data of person %d:n,"i+1); printf("Number is :");scanf("%s",sali.ID);printf("name:");scanf("%s",);fp1=fopen("input1" ,"wb" );for(i=0;i<m;i+) if (fwrite(&sali,sizeof(str
16、uct salman),1,fp1)!=1)printf("file write errorn" );fclose(fp1);fp1=fopen("input1" ,"rb" ); printf("nCheck the data:n" );for(i=0;i<m;i+) fread(&sali,sizeof(struct salman),1,fp1); printf("%s %s n" ,sali.ID,); fclose(fp1); getch();input(
17、); void input2() FILE *fp2;int i,m;printf("How many cars do you want to input?n"); printf("The amount is:");scanf("%d" ,&m);for(i=0;i<m;i+) printf( "The basic data of car %d:n",i+1); printf("The car number is :"); scanf("%s",cari.ID)
18、;printf("price:");scanf("%d" ,&cari.price);fp2=fopen("input2" ,"wb" );for(i=0;i<m;i+) if (fwrite(&cari,sizeof( struct salman),1,fp2)!=1) printf("file write errorn" );fclose(fp2);fp2=fopen("input2" ,"rb" ); printf("
19、nCheck the data:n" );for(i=0;i<m;i+) fread(&cari,sizeof(struct salman),1,fp2); printf("%s %dn" ,cari.ID,cari.price); fclose(fp2);getch();input();int input3_1(int i) printf( "Please input the data):"printf("nThe data %d:n" ,i+1); printf("The sales number
20、 is :)" scanf("%s",sadai.salman.ID);printf("The car number is :"); scanf("%s",sadai.car.ID); printf("The car's price is :)" scanf("%d" ,&sadai.car.price); printf("soldnum:");scanf("%d" ,&sadai.soldnum); printf(&qu
21、ot;day:");scanf("%d-%d-%d",&sadai.year,&sadai.month,&sadai.day); return;void input3() FILE *fp3;int i,m=0; char x; for(i=0;i<20;i+)if(strlen(sadai.salman.ID)!=0)m+;for(i=m;i<20-1;i+) input3_1(i);printf("Do you want to continue inputing new data?n)" printf(&
22、quot;Please input: 'Y' or 'N'n"); x=getch();printf( "Your choice:%c.n",x); if(x!='n'&&x!= 'N'&&x!= 'y'&&x!= 'Y') printf( "Wrong!choose again!n"); x=getch();printf("Your choice:%c.n" ,x);if(x= &
23、#39;y'|x= 'Y') continue;if(x= 'n'|x= 'N') break;fp3=fopen("input3" ,"wb" );for(m=0;m<i+1;m+) if (fwrite(&sadam,sizeof(struct salesdata),1,fp3)!=1) printf("file write errorn" ); fclose(fp3); fp3=fopen("input3" ,"rb"
24、); printf("nCheck the data:n" ); for(m=0;m<i+1;m+) fread(&sadams, izeof(struct salman),1,fp3); printf("%s %s %d %d%d-%d-%dn" ,sadam.salman.ID,sadam.car.ID,sadam.soldnum,sadam.car.price,sad am.year,sadam.month,sadam.day);fclose(fp3);getch();input();void insert() int i,m=0;f
25、or(i=0;i<20;i+)if(strlen(sadai.salman.ID)!=0) m+; input3_1(m);save();void Delete() char ID20;int i,j,b=0,m=0;for(i=0;i<20;i+)if(strlen(sadai.salman.ID)!=0) m+; printf("Enter the ID of the car which you want to delete!)" scanf("%s",ID);for(i=0;i<m;i+)if(strcmp(sadai.salma
26、n.ID,ID)=0) for(j=i;j<=m;j+) sadaj=sadaj+1;b=1; if(b=0) printf("Do not find out your data!n" );if(b=1) printf("Succeed!The data has been deleted!)n; " save();void modify() int i,j,b=0,m=0;char ID20;struct saldata int year,month,day;int soldnum,unitprice; char ID120,ID220;sada1
27、20; for(i=0;i<20;i+) if(strlen(sadai.salman.ID)!=0) m+; printf("Enter the ID of the person:"); scanf("%s",ID);for(i=0;i<m;i+) if(strcmp(sadai.salman.ID,ID)=0) printf( "Now,please input the new data):;" printf("nThe data %d:n" ,i+1); printf("The sale
28、s number is :)" scanf("%s",sada1i.ID1); printf("The car's number is :)"scanf("%s",sada1i.ID2); printf("The price is :"); scanf("%d" ,&sada1i.unitprice); printf("soldunmber:"); scanf("%d" ,&sada1i.soldnum); printf(
29、"day:");scanf("%d-%d-%d" ,&sada1i.year,&sada1i.month,&sada1i.day); strcpy(sadai.salman.ID,sada1i.ID1);strcpy(sadai.car.ID,sada1i.ID2); sadai.soldnum=sada1i.soldnum; sadai.car.price=sada1i.unitprice; sadai.year=sada1i.year;sadai.month=sada1i.month; sadai.day=sada1i.day
30、; b=1;if(b=0) printf( "Do not find out your data!n" );if(b=1) printf( "Succeed!The data has been modified!)n; " save();void editor() int m;printf("Which operation do you want to do?n"); printf("1-deleten");printf("2-modifyn" );printf("3-insertn&
31、quot; );printf("4-back to welcomen");printf("nYour choose:" );scanf("%d" ,&m);switch(m) case1: Delete(); break;case2: modify(); break;case3: insert(); break;case4: welcome(); break;default : printf("Error!n" );void search_salID() int i,flag=0;char ID15;pri
32、ntf("Please enter the number of person):;" scanf("%s",ID);for(i=0;i<20;i+)if(strcmp(sadai.salman.ID,ID)=0) printf( "The information of this number:n" );printf("sal_ID car_ID soldnum unitprice solddayn"); printf(" %s %s %d %d%d-%d-%dn" ,sadai.salma
33、n.ID,sadai.car.ID,sadai.soldnum,sadai.car.price,sadai.ye ar,sadai.month,sadai.day);flag=1;if(flag=0)printf("The number is not exist !n");save();void search_carID() char ID15;int i,flag=0;printf("Please enter the ID of car:)"scanf("%s",ID);for(i=0;i<20;i+)if(strcmp(sa
34、dai.car.ID,ID)=0) printf( "The information of this number:n" );printf("car_ID sal_ID soldnum unitprice solddayn");printf(" %s %s %d %d%d-%d-%dn" ,sadai.car.ID,sadai.salman.ID,sadai.soldnum,sadai.car.price,sadai.ye ar,sadai.month,sadai.day);flag=1;if(flag=0) printf( &quo
35、t;The carID is not exist !n" );save();void search() int m;printf("What do you want to search?n)"printf("1-the ID of 'person' n 2-the ID of 'car'n" );scanf("%d" ,&m);if(m!=1&&m!=2) printf( "wrong!enter again:)"scanf("%d&quo
36、t; ,&m);if(m=1) search_salID();if(m=2) search_carID();void calculat() int p20,sum=0,i,m=0;for(i=0;i<20;i+)if(strlen(sadai.salman.ID)!=0) m+;for(i=0;i<m;i+) pi=sadai.soldnum*sadai.car.price;sum=sum+pi; printf("Sal_ID: %-7stcar_ID: %-7stSales: %-10dn", sadai.salman.ID,sadai.car.ID,
37、pi);printf( "Total Sales: %dn",sum);save();void sort() int i,j,t,s,m=0,b20,a20;char temp20; for(i=0;i<20;i+)if(strlen(sadai.salman.ID)!=0) m+;for(i=0;i<m;i+) bi=sadai.soldnum*sadai.car.price; ai=sadai.soldnum;strcpy(sadai.all.ID,sadai.car.ID);for(i=1;i<m;i+) for(j=0;j<m-i;j+)if
38、(bj>bj+1) t=bj; bj=bj+1; bj+1=t; s=aj; aj=aj+1; aj+1=s;strcpy(temp,sadaj.all.ID); strcpy(sadaj.all.ID,sadaj+1.all.ID); strcpy(sadaj+1.all.ID,temp);for(i=0;i<m;i+)printf( "car_ID: %-5stsoldnum: %-5dtsale: %-10dn",sadai.all.ID,ai,bi); save();void browse() FILE *fp1,*fp2;int i,m=0;for(i=0;i<20;i+)if(strlen(sadai.salman.ID)!=0) m+; printf("Disply all the
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度新能源企業(yè)聘用合同范本4篇
- 二零二五年度人工智能輔助軟件服務(wù)合同模板2篇
- 二零二五美容院美容護(hù)理技術(shù)培訓(xùn)合同3篇
- 《短視頻編劇:選題構(gòu)想+腳本制作+劇本策劃+鏡頭拍攝》課件 第5章 了解劇本:創(chuàng)作優(yōu)劇本的基礎(chǔ)
- 二零二五年度某局勞務(wù)分包結(jié)算與人才培養(yǎng)計(jì)劃合同4篇
- 二零二五農(nóng)機(jī)綠色生產(chǎn)技術(shù)研發(fā)與應(yīng)用合同4篇
- 二零二五年度棉被品牌授權(quán)生產(chǎn)及銷售合同4篇
- 二零二五年度智能制造名義合伙人合同4篇
- 二零二五版南京海事法院海洋石油開發(fā)合同4篇
- (必會(huì))公路水運(yùn)工程助理試驗(yàn)檢測(cè)師《交通工程》近年考試真題題庫(kù)(含答案解析)
- 七年級(jí)英語(yǔ)閱讀理解55篇(含答案)
- 臨床常見(jiàn)操作-灌腸
- 案例分析:美國(guó)紐約高樓防火設(shè)計(jì)課件
- 老客戶維護(hù)方案
- 移動(dòng)商務(wù)內(nèi)容運(yùn)營(yíng)(吳洪貴)任務(wù)一 用戶定位與選題
- 萬(wàn)科物業(yè)管理公司全套制度(2016版)
- 2021年高考化學(xué)真題和模擬題分類匯編專題20工業(yè)流程題含解析
- 工作證明模板下載免費(fèi)
- (完整word)長(zhǎng)沙胡博士工作室公益發(fā)布新加坡SM2考試物理全真模擬試卷(附答案解析)
- 機(jī)械點(diǎn)檢員職業(yè)技能知識(shí)考試題庫(kù)與答案(900題)
- 成熙高級(jí)英語(yǔ)聽力腳本
評(píng)論
0/150
提交評(píng)論