




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、西安郵電學(xué)院軟體設(shè)計報告題 目:汽車銷售管理系統(tǒng)院系名稱:電子工程學(xué)院 專業(yè)名稱:光電資訊工程班 級:光電1101班 學(xué)生姓名:林時堯?qū)W號(8位):05114016指導(dǎo)教師:王西龍設(shè)計起止時間:1512年04月12日1512年04月19日一. 設(shè)計目的隨著近年來我國經(jīng)濟的發(fā)展,國民生活水平的提高,國內(nèi)的汽車產(chǎn)業(yè)開始迅猛發(fā)展,人民群眾對于各種汽車的需求也是日益增多,也因此產(chǎn)生了很多汽車銷售公司。在這些汽車銷售公司你,他們都沒有一套好的銷售模式.因此,制作一套汽車銷售管理系統(tǒng)有助于公司對汽車的管理、銷售、提高利潤,并且方便了客戶查看汽車的信息、購買汽車,也更加了解各種汽車的性能和使用性.選擇適合自
2、己的汽車。二。 設(shè)計內(nèi)容第一步:需求分析 主要任務(wù)就是通過詳細調(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)進行管理和維護.三概要設(shè)計1功能模塊圖;功能模塊圖:主菜單查詢退出流覽排序計算編輯輸入 添加銷售資料刪除銷售資料修改銷售資料輸入銷售員資料輸入產(chǎn)品資料輸入銷售總數(shù)據(jù)按產(chǎn)品編號查詢按銷售員編號查詢2各個模塊詳細的功能描述。1
3、)主函數(shù)main():協(xié)調(diào)各個模塊的順序,讓程序井然有序地按照事先安排的進行。2)歡迎接口函數(shù)welcome():作為程序的第一形象,歡迎用戶使用本程序.3)輸入數(shù)據(jù)函數(shù)void input():讀取數(shù)據(jù),為之后的程序運行提供了數(shù)據(jù)基礎(chǔ)。4)輸入銷售員數(shù)據(jù)函數(shù)void input1():讀取數(shù)據(jù),與數(shù)字數(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ù)進行清除,在編輯數(shù)據(jù)時使用。7)插入銷售數(shù)據(jù)函數(shù)void insert
4、():對于一名銷售員來說有可能一次完成多次銷售,此時用插入數(shù)據(jù)函數(shù)可以將幾次銷售記錄在一起,在編輯數(shù)據(jù)時使用。8)修改銷售數(shù)據(jù)函數(shù)void modify():管理數(shù)據(jù)時對數(shù)據(jù)可以進行任何修改,在編輯資料時使用.9)計算銷售總額和每種產(chǎn)品的銷售額void calculat():便于日后對銷售額和利潤進行計算。10)根據(jù)銷售員編號來查詢資料 void search_salID():便于日后對銷售員根據(jù)業(yè)績進行考核.11)對銷售數(shù)據(jù)進行排序void sort():有利于客戶在選車時直觀的了解汽車的銷售資料。四詳細設(shè)計1功能函數(shù)的調(diào)用關(guān)系圖函數(shù)名函數(shù)原型功能返回值說明fcloseint fclose(
5、FILE fp)關(guān)閉fp所指的文件,釋放文件緩沖區(qū)。有錯則返回非0,否則返回0feofint feof(FILE *fp)檢查檔是否結(jié)束,遇文件結(jié)束符返回非零值,否則返回0.fopenFILEopen(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é)束或出錯返回0fwrit
6、eint fwirte (char ptr,unsigned size unsigned n,F(xiàn)ILE *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ù).若出錯,返回負數(shù)Format字符串,或字符數(shù)組起始地址scanfint scanf (char *format,a
7、rgs,);從標(biāo)準(zhǔn)的輸入設(shè)備按format指向的格式字符串所規(guī)定的格式,輸入數(shù)據(jù)給args所指向的單元讀入并賦給args的數(shù)據(jù)個數(shù)。遇文件結(jié)束返回EOF,出錯返回0Args為指針strcmpint strcmp(char str1,char *str2);比較兩個字符串str1,str2str1<str2,返回負數(shù);str1=str2,返回0;str1str2,返回正數(shù)包含檔string.hstrcpychar strcpy(charstr1,char str2);把str2指向的字符串復(fù)制str1到去返回str1包含檔string。hstrlenunsigned int strlen(
8、char *str);統(tǒng)計字符串中str中字符的個數(shù)(不包括終止符0)返回字符個數(shù)包含檔string.h2各功能函數(shù)的數(shù)據(jù)流程圖;3重點設(shè)計及編碼。五測試資料及運行結(jié)果1正常測試數(shù)據(jù)(3組)及運行結(jié)果;2非正常測試數(shù)據(jù)(2組)及運行結(jié)果。六調(diào)試情況,設(shè)計技巧及體會1對自己的設(shè)計進行評價,指出合理和不足之處,提出改進方案;2對設(shè)計及調(diào)試過程的心得體會。七參考文獻八附錄:源代碼includestdio.h includestring.h #include<conio。h> struct salman char ID15; char name15; sal20; struct car c
9、har ID15; int price; car20; struct salesdata int year; int month; 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 # 3Browse the data #n");print
10、f("tt 4-Calculat #n");printf(”tt # 5-Sort n”);printf(”tt # 6Search 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 'Nn"); x=getch(); printf(”Your choic
11、e: %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=Y') printf("please input the name of the file!n"); scanf(”s”,all); i
12、f((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); return;void input() int m; void input1(); void input2(); void input3(); printf(”which data do you want to input?n
13、"); 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("Error
14、!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;i<m;i+) printf(”The basic data of person d:n”,i+1); printf(”Number is :”); scanf(”%s",sali.ID); printf("name:"); scanf(”%s&q
15、uot;,sali。name); fp1=fopen(”input1",”wb"); for(i=0;i<m;i+) 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(
16、"s %s n”,sali。ID,sali。name); fclose(fp1); getch(); input(); 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;im;i+) printf(”The basic data of car %d:n",i+1); printf(”The car number is :
17、”); scanf(”s",cari。ID); 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("nCheck the data
18、: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 is :"); scanf("s",sadai。
19、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("day:"); scanf("d-d-d",&sadai。year,sadai.month,&sada
20、i。day); return; void input3() FILE fp3; int i,m=0; char x; for(i=0;i20;i+) if(strlen(sadai。salman.ID)!=0) m+; for(i=m;i<201;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!=
21、9;n'x!=N'&x!=yx!='Y) printf(”Wrong!choose again!n"); x=getch(); printf("Your choice:c.n",x); if(x='yx='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)
22、,1,fp3)!=1) printf("file write errorn”); fclose(fp3); fp3=fopen("input3",”rb"); printf(”nCheck the data:n”); for(m=0;m<i+1;m+) fread(&sadam,sizeof(struct salman),1,fp3); printf(”%s s %d %d %d-%d%dn",sadam。salman。ID,sadam。car.ID,sadam。soldnum,sadam.car.price,sadam。year
23、,sadam。month,sadam.day); fclose(fp3); getch(); input();void insert() int i,m=0; for(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;i20;i+) if(strlen(sadai。salman.ID)!=0) m+; printf(”Enter the ID of the car which you want to d
24、elete!"); 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 deleted!n”); save();void modify() int i,j,b=0,m=0; char ID20; struct saldata int year,month
25、,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;i<m;i+) if(strcmp(sadai.salman。ID,ID)=0) printf("Now,please input the new data:”); printf("nThe data d:n"
26、,i+1); printf(”The sales 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(”day:”); scanf("%d-%d%d",&sa
27、da1i.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"
28、); 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(”2modifyn"); printf("3insertn"); printf("4back to welcomen”); printf("nYour choose:”); scanf(”d”,&m); sw
29、itch(m) case 1: Delete(); break; case 2: modify(); break; case 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
30、,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。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()
31、;void search_carID() char ID15; int i,flag=0; printf(”Please enter the ID of car:"); scanf(”s",ID);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-%ddn”,sadai.car.ID,sa
32、dai.salman。ID,sadai.soldnum,sadai.car。price,sadai.year,sadai.month,sadai.day); flag=1; if(flag=0) printf("The carID is not exist !n”); save();void search() int m; printf(”What do you want to search?n"); printf(”1the ID of 'person n 2the ID of 'carn”); scanf(”d",&m); if(m!=
33、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;i<20;i+) if(strlen(sadai。salman。ID)!=0) m+;for(i=0;i<m;i+) pi=sadai。soldnumsadai.car.price; sum=sum+pi; printf(”Sal_ID: -7st
34、car_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.salman.ID)!=0) m+;for(i=0;im;i+) bi=sadai。soldnum*sadai。car.price; ai=sadai.soldnum; strcpy(sadai。all。ID,sadai。car.ID);
35、for(i=1;im;i+) for(j=0;jm-i;j+) if(bjbj+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;i<20;i+) if(strlen(sadai.salman.ID)!=
溫馨提示
- 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)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025至2030轉(zhuǎn)向臂起重機行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 2025至2030中國自穿孔鉚釘行業(yè)市場占有率及投資前景評估規(guī)劃報告
- 2025至2030中國自助秤行業(yè)發(fā)展趨勢分析與未來投資戰(zhàn)略咨詢研究報告
- 2025至2030中國自動視覺檢測系統(tǒng)行業(yè)市場占有率及投資前景評估規(guī)劃報告
- 2025至2030中國腕帶高爾夫GPS行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 2025至2030中國腳輪上的患者升降平臺行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 2025至2030中國胃腸病學(xué)設(shè)備行業(yè)市場深度研究及發(fā)展前景投資可行性分析報告
- 2025至2030中國腸內(nèi)飼管行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 2025至2030中國聚苯醚(PPE)混合物和合金行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 2025至2030中國聚丙烯蜂窩行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 哪些農(nóng)產(chǎn)品免稅(免稅農(nóng)產(chǎn)品包括哪些)
- 鍍鋅板國家新標(biāo)準(zhǔn)規(guī)定
- 《電工學(xué)》“課程思政”教學(xué)設(shè)計案例
- 融資合作協(xié)議模板(2篇)
- 數(shù)字時代的商務(wù)英語寫作知到章節(jié)答案智慧樹2023年對外經(jīng)濟貿(mào)易大學(xué)
- 檢驗科溝通技巧及其它
- 2022年安徽大學(xué)科研助理(校聘)招聘60人筆試備考題庫及答案解析
- 四年級閱讀訓(xùn)練概括文章主要內(nèi)容(完美)
- YY/T 0995-2015人類輔助生殖技術(shù)用醫(yī)療器械術(shù)語和定義
- GB/T 19352.1-2003熱噴涂熱噴涂結(jié)構(gòu)的質(zhì)量要求第1部分:選擇和使用指南
- 智護訓(xùn)練講解學(xué)習(xí)課件
評論
0/150
提交評論