




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、西安郵電學(xué)院軟體設(shè)計報告題 目:汽車銷售管理系統(tǒng)院系名稱:電子工程學(xué)院 專業(yè)名稱:光電資訊工程班 級:光電1101班 學(xué)生姓名:學(xué)號(8位):指導(dǎo)教師:設(shè)計起止時間:1512年04月12日1512年04月19日一. 設(shè)計目的隨著近年來我國經(jīng)濟的發(fā)展,國民生活水平的提高,國內(nèi)的汽車產(chǎn)業(yè)開始迅猛發(fā)展,人民群眾對于各種汽車的需求也是日益增多,也因此產(chǎn)生了很多汽車銷售公司。在這些汽車銷售公司你,他們都沒有一套好的銷售模式。因此,制作一套汽車銷售管理系統(tǒng)有助于公司對汽車的管理、銷售、提高利潤,并且方便了客戶查看汽車的信息、購買汽車,也更加了解各種汽車的性能和使用性。選擇適合自己的汽車。二. 設(shè)計內(nèi)容第一
2、步:需求分析 主要任務(wù)就是通過詳細(xì)調(diào)查現(xiàn)實世界要處理的對象,明確用戶的各種需求,然后在此基礎(chǔ)上確定新系統(tǒng)的功能。在我設(shè)計的這個系統(tǒng)主要是調(diào)查客戶對汽車的需求情況,客戶想了解汽車的哪些信息,有哪些要求等等。第二步:概念結(jié)構(gòu)設(shè)計 主要就是將需求分析階段得到的用戶需求抽象為信息世界的結(jié)構(gòu)才能更好的用數(shù)據(jù)庫管理系統(tǒng)來實現(xiàn)這些需求。第三步:對汽車銷售管理系統(tǒng)進(jìn)行管理和維護。三概要設(shè)計1功能模塊圖;功能模塊圖:主菜單查詢退出流覽排序計算編輯輸入 添加銷售資料刪除銷售資料修改銷售資料輸入銷售員資料輸入產(chǎn)品資料輸入銷售總數(shù)據(jù)按產(chǎn)品編號查詢按銷售員編號查詢2各個模塊詳細(xì)的功能描述。1)主函數(shù)main():協(xié)調(diào)各
3、個模塊的順序,讓程序井然有序地按照事先安排的進(jìn)行。2)歡迎接口函數(shù)welcome():作為程序的第一形象,歡迎用戶使用本程序。3)輸入數(shù)據(jù)函數(shù)void input():讀取數(shù)據(jù),為之后的程序運行提供了數(shù)據(jù)基礎(chǔ)。4)輸入銷售員數(shù)據(jù)函數(shù)void input1():讀取數(shù)據(jù),與數(shù)字?jǐn)?shù)據(jù)有所不同,是記錄有關(guān)銷售員信息的字符數(shù)據(jù)。5)輸入銷售數(shù)據(jù)函數(shù)void input3():讀取數(shù)據(jù),有關(guān)于銷售的資料。6)刪除銷售數(shù)據(jù)函數(shù)void delete():在取消本次銷售或者本次銷售出現(xiàn)任何問題時使用,可以對數(shù)據(jù)進(jìn)行清除,在編輯數(shù)據(jù)時使用。7)插入銷售數(shù)據(jù)函數(shù)void insert():對于一名銷售員來說有可
4、能一次完成多次銷售,此時用插入數(shù)據(jù)函數(shù)可以將幾次銷售記錄在一起,在編輯數(shù)據(jù)時使用。8)修改銷售數(shù)據(jù)函數(shù)void modify():管理數(shù)據(jù)時對數(shù)據(jù)可以進(jìn)行任何修改,在編輯資料時使用。9)計算銷售總額和每種產(chǎn)品的銷售額void calculat():便于日后對銷售額和利潤進(jìn)行計算。10)根據(jù)銷售員編號來查詢資料 void search_salid():便于日后對銷售員根據(jù)業(yè)績進(jìn)行考核。11)對銷售數(shù)據(jù)進(jìn)行排序void sort():有利于客戶在選車時直觀的了解汽車的銷售資料。四詳細(xì)設(shè)計1功能函數(shù)的調(diào)用關(guān)系圖函數(shù)名函數(shù)原型功能返回值說明fcloseint fclose(file *fp)關(guān)閉fp所
5、指的文件,釋放文件緩沖區(qū)。有錯則返回非0,否則返回0feofint feof(file *fp)檢查檔是否結(jié)束,遇文件結(jié)束符返回非零值,否則返回0。fopenfile*open(char *filename,char mode)以mode指定的方式打開名為filename的檔成功,返回一個文件指針(文件信息區(qū)的起始地址),否則返回0。freadint fread(char *pt,unsignedsize,unsigned n,file *fp);從fp所指定的檔中讀取長度為size的n個數(shù)據(jù)項,存到pt所指定向的內(nèi)存區(qū)返回所讀的數(shù)據(jù)項個數(shù),如遇文件結(jié)束或出錯返回0fwriteint fwir
6、te (char *ptr,unsigned size unsigned n,file *fp);把ptr所指向的n *size個字節(jié)輸出到fp所指向的檔中寫到fp文件中的數(shù)據(jù)項的個數(shù)getcharint getchar(void);從標(biāo)準(zhǔn)輸入設(shè)備讀取下一個字符。讀字符。若文件結(jié)束或出錯,則返回-1printfint printf(char *format,args,)按format指向的格式字符串規(guī)定的格式,將輸出表列args的值輸出到標(biāo)準(zhǔn)輸出設(shè)備。輸出字符的個數(shù)。若出錯,返回負(fù)數(shù)format字符串,或字符數(shù)組起始地址scanfint scanf (char *format,args,);從
7、標(biāo)準(zhǔn)的輸入設(shè)備按format指向的格式字符串所規(guī)定的格式,輸入數(shù)據(jù)給args所指向的單元讀入并賦給args的數(shù)據(jù)個數(shù)。遇文件結(jié)束返回eof,出錯返回0args為指針strcmpint strcmp(char *str1,char *str2);比較兩個字符串str1,str2str1str2,返回正數(shù)包含檔string.hstrcpychar *strcpy(char*str1,char *str2);把str2指向的字符串復(fù)制str1到去返回str1包含檔string.hstrlenunsigned int strlen(char *str);統(tǒng)計字符串中str中字符的個數(shù)(不包括終止符0)
8、返回字符個數(shù)包含檔string.h2各功能函數(shù)的數(shù)據(jù)流程圖;3重點設(shè)計及編碼。五測試資料及運行結(jié)果1正常測試數(shù)據(jù)(3組)及運行結(jié)果;2非正常測試數(shù)據(jù)(2組)及運行結(jié)果。六調(diào)試情況,設(shè)計技巧及體會1對自己的設(shè)計進(jìn)行評價,指出合理和不足之處,提出改進(jìn)方案;2對設(shè)計及調(diào)試過程的心得體會。七參考文獻(xiàn)八附錄:源代碼#include #include #include struct salman char id15; char name15; sal20; struct car char id15; int price; car20; struct salesdata int year; int mont
9、h; int day; 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(tt # 5-sort #n);printf(tt # 6-search #n);printf(tt # 7-exi
10、t 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 nn); x=getch(); printf(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(); r
11、eturn; if(x=y|x=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;i15;i+) fwrite(&sadai,sizeof(struct salman),1,fp); printf(*save succeed*n); fclose(fp); return;void input() int m; void input1(); void input2(); v
12、oid 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,&m); switch(m) case 1: input1(); break; case 2: input2(); break; case 3: input3(); break; case 4: welcome(); break; default : printf
13、(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,&m); for(i=0;im;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;im;i
14、+) if(fwrite(&sali,sizeof(struct salman),1,fp1)!=1) printf(file write errorn); fclose(fp1); fp1=fopen(input1,rb); printf(ncheck the data:n); for(i=0;im;i+) fread(&sali,sizeof(struct salman),1,fp1); printf(%s %s n,sali.id,); fclose(fp1); getch(); input(); void input2() file *fp2; int i,m; pr
15、intf(how many cars do you want to input?n); printf(the amount is:); scanf(%d,&m); for(i=0;im;i+) printf(the basic data of car %d:n,i+1); printf(the car number is :); scanf(%s,cari.id); printf(price:); scanf(%d,&cari.price); fp2=fopen(input2,wb); for(i=0;im;i+) if(fwrite(&cari,sizeof(struct salman),1
16、,fp2)!=1) printf(file write errorn); fclose(fp2); fp2=fopen(input2,rb); printf(ncheck the data:n); for(i=0;im;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);
17、 printf(the sales number is :); scanf(%s,sadai.salman.id); printf(the car number is :); scanf(%s,sadai.car.id); printf(the cars price is :); scanf(%d,&sadai.car.price); printf(soldnum:); scanf(%d,&sadai.soldnum); printf(day:); scanf(%d-%d-%d,&sadai.year,&sadai.month,&sadai.day); return; void input3(
18、) file *fp3; int i,m=0; char x; for(i=0;i20;i+) if(strlen(sadai.salman.id)!=0) m+; for(i=m;i20-1;i+) input3_1(i); printf(do you want to continue inputing new data?n); printf(please input: y or nn); x=getch();printf(your choice:%c.n,x); if(x!=n&x!=n&x!=y&x!=y) printf(wrong!choose again!n); x=getch();
19、 printf(your choice:%c.n,x); if(x=y|x=y) continue; if(x=n|x=n) break; fp3=fopen(input3,wb); for(m=0;mi+1;m+) if(fwrite(&sadam,sizeof(struct salesdata),1,fp3)!=1) printf(file write errorn); fclose(fp3); fp3=fopen(input3,rb); printf(ncheck the data:n); for(m=0;mi+1;m+) fread(&sadam,sizeof(struct salma
20、n),1,fp3); printf(%s %s %d %d %d-%d-%dn,sadam.salman.id,sadam.car.id,sadam.soldnum,sadam.car.price,sadam.year,sadam.month,sadam.day); fclose(fp3); getch(); input();void insert() int i,m=0; for(i=0;i20;i+) if(strlen(sadai.salman.id)!=0) m+; input3_1(m); save(); void delete() char id20; int i,j,b=0,m=
21、0; for(i=0;i20;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;im;i+) if(strcmp(sadai.salman.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 del
22、eted!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; sada120;for(i=0;i20;i+) if(strlen(sadai.salman.id)!=0) m+; printf(enter the id of the person:); scanf(%s,id);for(i=0;im;i+) if(strcmp(sadai.salman.id,id)=0) printf(no
23、w,please input the new data:); printf(nthe data %d:n,i+1); printf(the sales number is :); scanf(%s,sada1i.id1); printf(the cars number is :); scanf(%s,sada1i.id2); printf(the price is :); scanf(%d,&sada1i.unitprice); printf(soldunmber:); scanf(%d,&sada1i.soldnum); printf(day:); scanf(%d-%d-%d,&sada1
24、i.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; b=1; if(b=0) printf(do not find out your data!n); if(b=1) pr
25、intf(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); printf(4-back to welcomen); printf(nyour choose:); scanf(%d,&m); switch(m) case 1: delete(); break; case 2: modify(); break; c
26、ase 3: insert(); break; case 4: welcome(); break; default : printf(error!n); void search_salid() int i,flag=0; char id15; printf(please enter the number of person:); scanf(%s,id); for(i=0;i20;i+) if(strcmp(sadai.salman.id,id)=0) printf(the information of this number:n); printf(sal_id car_id soldnum
27、unitprice solddayn); printf( %s %s %d %d %d-%d-%dn,sadai.salman.id,sadai.car.id,sadai.soldnum,sadai.car.price,sadai.year,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
28、);for(i=0;i20;i+) if(strcmp(sadai.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.year,sadai.month,sadai.day); flag=1; if(flag=0) printf(the carid
29、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 carn); scanf(%d,&m); if(m!=1&m!=2) printf(wrong!enter again:); scanf(%d,&m); if(m=1) search_salid(); if(m=2) search_carid(); void calculat() int p20,sum=0,i,m=0; for(i=0;i20;i+
30、) if(strlen(sadai.salman.id)!=0) m+;for(i=0;im;i+) pi=sadai.soldnum*sadai.car.price; sum=sum+pi; printf(sal_id: %-7stcar_id: %-7stsales: %-10dn, sadai.salman.id,sadai.car.id,pi); printf(total sales: %dn,sum); save();void sort() int i,j,t,s,m=0,b20,a20; char temp20; for(i=0;i20;i+) if(strlen(sadai.sa
31、lman.id)!=0) m+;for(i=0;im;i+) bi=sadai.soldnum*sadai.car.price; ai=sadai.soldnum; strcpy(sadai.all.id,sadai.car.id); for(i=1;im;i+) for(j=0;jbj+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;im;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;i20;i+) if(strlen(sadai.salman.id)!=0) m
溫馨提示
- 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 南京車輛抵押合同范本
- 小學(xué)美術(shù)德育教育路徑探討
- 醫(yī)療設(shè)備 銷售合同范本
- 審美人格視域下江海美術(shù)多元教學(xué)
- 凈水器安裝勞務(wù)合同范本
- 廠房圍墻施工合同范本
- 出版合同范本填寫規(guī)范
- 印刷出版合同范本
- 農(nóng)業(yè)開發(fā)項目合同范本
- 個人房產(chǎn)抵押合同范例
- 廣東省廣州市天河區(qū)2024-2025學(xué)年八年級(上)期末物理試卷(含答案)
- 2024年山東司法警官職業(yè)學(xué)院高職單招語文歷年參考題庫含答案解析
- 計算機網(wǎng)絡(luò)基礎(chǔ)與應(yīng)用中職完整全套教學(xué)課件
- 2022版義務(wù)教育藝術(shù)課程標(biāo)準(zhǔn)美術(shù)新課標(biāo)學(xué)習(xí)解讀課件
- 四年級四年級下冊閱讀理解20篇(附帶答案解析)經(jīng)典
- 園林綠化施工通用表格模板
- 人民檢察院信訪案件終結(jié)辦法
- 最新三級醫(yī)師查房督導(dǎo)評分細(xì)則及檢查登記表資料
- 充分發(fā)揮機關(guān)女性半邊天作用
- 蘋果樹病蟲害防治歷.doc
評論
0/150
提交評論