




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、目 錄一、設(shè)計(jì)題目1二、設(shè)計(jì)目的1三、設(shè)計(jì)說(shuō)明1四、總體設(shè)計(jì)2五、詳細(xì)設(shè)計(jì)3六、結(jié)論7七、附錄(程序源代碼):7一、 設(shè)計(jì)題目汽車(chē)汽修管理系統(tǒng)二、設(shè)計(jì)目的1.通過(guò)課程設(shè)計(jì)掌握面向?qū)ο蟮某绦蛟O(shè)計(jì)思路。2.通過(guò)課程設(shè)計(jì)掌握類(lèi)的繼承、抽象類(lèi)、多態(tài)、虛基類(lèi)的應(yīng)用方法。3.通過(guò)課程設(shè)計(jì)掌握c+中對(duì)文件進(jìn)行查找、刪除、修改等操作方法。三、設(shè)計(jì)說(shuō)明1. 系統(tǒng)功能需求描述本系統(tǒng)主要實(shí)現(xiàn)車(chē)輛信息、車(chē)輛修理單信息的插入、刪除及查詢等功能。編程實(shí)現(xiàn)汽車(chē)汽修管理系統(tǒng),主要汽車(chē)汽修管理系統(tǒng)。其中車(chē)輛信息應(yīng)該包括車(chē)牌號(hào)、牌號(hào)、型號(hào)、生產(chǎn)廠家、修理項(xiàng)目碼、修理日期、修理項(xiàng)目、修理小時(shí)數(shù)、完工日期。車(chē)輛修理菜單信息包括修理單
2、編號(hào)、修理工工號(hào)、修理日期、修理項(xiàng)目、修理小時(shí)數(shù)、完工日期。具體功能如下:(1)用戶登錄界面設(shè)計(jì)。(2)信息維護(hù):包括車(chē)輛信息維護(hù):增加車(chē)輛信息、刪除車(chē)輛信息、膝蓋車(chē)輛信息。包括車(chē)輛修理單信息維護(hù):增加車(chē)輛修理單信息、刪除和良修理單信息、修改車(chē)輛修理單信息。(3)信息查詢:對(duì)車(chē)輛信息查詢時(shí)可實(shí)現(xiàn)按車(chē)輛名查詢、按車(chē)主名查詢等多條件查詢。對(duì)車(chē)輛修理單信息查詢時(shí)可實(shí)現(xiàn)按車(chē)輛修理單號(hào)查詢、按修理工工號(hào)查詢等多條件查詢。(4)修理單統(tǒng)計(jì):按月統(tǒng)計(jì)輸出上的汽車(chē)修理單信息。按月統(tǒng)計(jì)每個(gè)修理工的月修理信息。2. 系統(tǒng)運(yùn)行環(huán)境(1)硬件環(huán)境。本系統(tǒng)適用于那種inter386以上計(jì)算機(jī),內(nèi)存容量為128m,應(yīng)配備
3、鍵盤(pán)、鼠標(biāo)、顯示器等外部設(shè)備。(2)軟件環(huán)境。本系統(tǒng)的設(shè)計(jì)采用visual c+6.0編寫(xiě)。在windows xp sp2環(huán)境下測(cè)試通過(guò)。四、總體設(shè)計(jì)1. 數(shù)據(jù)設(shè)計(jì)(1)類(lèi)設(shè)計(jì)車(chē)輛信息類(lèi)car_infor,該類(lèi)有共同的信息車(chē)牌號(hào)car_no、牌號(hào)car_brand、型號(hào)car_modles、生產(chǎn)廠家manufacturer、修理項(xiàng)目碼repair_code、車(chē)主姓名owner_name、聯(lián)系電話phone_nomber、修理日期repair_time。車(chē)輛修理菜單信息類(lèi)repair_list,該類(lèi)有共同的修理單編號(hào)list_no、修理工工號(hào)repaiman_no、修理日期repair_time
4、、修理項(xiàng)目project、修理小時(shí)數(shù)repair_hours、完工日期complete_time。用戶信息類(lèi)user,該類(lèi)有成員用戶名user_name、密碼password。功能類(lèi)fun,該類(lèi)中包含所有的功能函數(shù),實(shí)現(xiàn)對(duì)車(chē)輛信息及車(chē)輛修理單信息的增加、修改、刪除以及統(tǒng)計(jì)等實(shí)用功能。void add()增加車(chē)輛信息,void del()刪除車(chē)輛信息,void modify ()修改車(chē)輛信息,void add_list()增加車(chē)輛修理單信息,void del_list()刪除車(chē)輛修理單信息,void modify_list()修改車(chē)輛修理單信息,int judge()判斷函數(shù),void quer
5、y_car()查詢車(chē)輛信息,void query_list()查詢車(chē)輛修理單信息,void query_car_no()按車(chē)輛名查詢,void query_owner_name()按車(chē)主名查詢,void query_repaiman_no()按修理工工號(hào)查詢,void query_rlist_no()按車(chē)輛修理單號(hào)查詢,statistics()修理單統(tǒng)計(jì)等。(2)函數(shù)設(shè)計(jì)int registe()用戶注冊(cè),int judge6()用戶登錄,void add()增加車(chē)輛信息,void del()刪除車(chē)輛信息,void add_list()增加車(chē)輛修理單信息,void modify ()修改車(chē)輛信
6、息,void del_list()刪除車(chē)輛修理單信息,void modify_list()修改車(chē)輛修理單信息,int judge()判斷函數(shù),void query_car()查詢車(chē)輛信息,void query_list()查詢車(chē)輛修理單信息,void query_car_no()按車(chē)輛名查詢,void query_owner_name()按車(chē)主名查詢,void query_repaiman_no()按修理工工號(hào)查詢,void query_rlist_no()按車(chē)輛修理單號(hào)查詢,void statistics()1按月輸出汽車(chē)修理單信息,void statistics()2統(tǒng)計(jì)每個(gè)修理工的月修理
7、信息。2. 結(jié)構(gòu)設(shè)計(jì) 系統(tǒng)流程圖如圖4-1所示。圖4-1 系統(tǒng)流程圖五、詳細(xì)設(shè)計(jì)(1)用戶登錄/注冊(cè)界面設(shè)計(jì)圖5-1 用戶登錄界面此界面用戶通過(guò)選擇進(jìn)行登錄、注冊(cè)操作,通過(guò)調(diào)用函數(shù)registe(),judge6()實(shí)現(xiàn)相關(guān)功能。 (2)汽車(chē)汽修管理系統(tǒng)界面圖5-2 汽車(chē)汽修管理系統(tǒng)界面通過(guò)用戶選擇相關(guān)功能進(jìn)行操作,由menu()函數(shù)實(shí)現(xiàn)顯示功能,用戶根據(jù)相關(guān)提示進(jìn)入下一步。(3)增加車(chē)輛信息圖5-3增加車(chē)輛信息用戶按照提示輸入,進(jìn)入相關(guān)調(diào)用及選擇如圖中調(diào)用add()函數(shù)實(shí)現(xiàn)對(duì)數(shù)據(jù)的增加操作。(4).刪除車(chē)輛信息圖5-4刪除車(chē)輛信息此界面實(shí)現(xiàn)對(duì)信息的刪除操作,調(diào)用del()函數(shù),實(shí)現(xiàn)中先判斷有
8、無(wú)此信息,然后進(jìn)行相關(guān)操作。(5)修改車(chē)輛信息圖5-5修改車(chē)輛信息此界面調(diào)用了modify()函數(shù),系統(tǒng)先判斷有無(wú)此信息,然后用戶根據(jù)提示,找到數(shù)據(jù),進(jìn)行修改操作。(6)查詢車(chē)輛信息圖5-6查詢車(chē)輛信息此界面調(diào)用query_car()函數(shù),此函數(shù)包含其他兩函數(shù)工能,因此用戶根據(jù)提示選擇自己的查詢方式。(7)統(tǒng)計(jì)車(chē)輛修理單信息圖5-7統(tǒng)計(jì)車(chē)輛修理單信息此界面調(diào)statistics()函數(shù),此函數(shù)包含其他兩函數(shù)工能,因此用戶根據(jù)提示選擇相關(guān)需要統(tǒng)計(jì)。六、結(jié)論這次做的是汽車(chē)汽修管理系統(tǒng),能夠很好的實(shí)現(xiàn)對(duì)相關(guān)信息的增加、刪除、修改、查詢以及用戶的注冊(cè)、登錄等功能。并且還能夠?qū)崿F(xiàn)相關(guān)功能間的循環(huán)轉(zhuǎn)換,本
9、次開(kāi)發(fā)主要用了c+中對(duì)于類(lèi)以及文件的使用,大部分功能的實(shí)現(xiàn)依靠文件的相關(guān)控制。因此在實(shí)現(xiàn)和代碼上有許多值得改進(jìn)和的地方。由于時(shí)間原因,程序功能相關(guān)部分,還有許多地方值得推敲和拓展開(kāi)發(fā)。 開(kāi)發(fā)過(guò)程中,由于是開(kāi)發(fā)者單獨(dú)的設(shè)計(jì)和編寫(xiě),所以在某些功能上可能與實(shí)際的需求有出入,主要是在技術(shù)上和需求分析上問(wèn)題,因此該系統(tǒng)還是有尚需要改進(jìn)的部分??赡芤?yàn)闀r(shí)間的原因,有些地方做得不夠精細(xì),所學(xué)的東西不能全部用好。多多把所學(xué)的運(yùn)用到實(shí)際中是以后的編程中應(yīng)該加強(qiáng)和注意的。 七、附錄(程序源代碼):#include#include#include#include #include#includeusing name
10、space std;/*車(chē)輛信息類(lèi)*class car_inforpublic:car_infor()private:string car_no;/車(chē)牌號(hào)string car_brand;/牌號(hào)string car_modles;/型號(hào)string manufacturer;/生產(chǎn)廠家string repair_code;/修理項(xiàng)目碼string owner_name;/車(chē)主姓名string phone_number;/聯(lián)系電話string repair_time;/修理日期;/*修理單類(lèi)*class repair_listpublic:repair_list()private:string
11、list_no;/修理單編號(hào)string repairman_no;/修理工工號(hào)string repair_time;/修理日期string project;/修理項(xiàng)目string repair_hours;/修理小時(shí)數(shù)string complete_time;/完工日期;/*用戶信息類(lèi)*class userpublic:user()private:string user_name;/用戶名string password;/密碼;/*功能類(lèi)*class funpublic:fun()/*信息維護(hù)*/*增加車(chē)輛信息*void add() system(cls);string a,b,c,d,e,
12、f,g,h;string line;ofstream car(d:cars.txt, ios:app);if(!car)cerropen error!endl;exit(1);int flag=1;while(flag)coutendlendl;coutttt*endl;coutttt1.增加汽車(chē)信息endlendl;coutttt0.返回上一菜單endl;coutttt*endl;coutn;switch(n)case 1:system(cls);coutendl;coutt請(qǐng)按提示輸入車(chē)輛信息:endlendl;couta;coutendl;coutb;coutendl;coutc;cou
13、tendl;coutd;coutendl;coute;coutendl;coutf;coutendl;coutg;coutendl;couth;coutendl;car setiosflags(ios:left)a b c d e f g hendl;system(cls);cout endl tt 信息錄入完成! endl endl;system(pause);break; case 0:flag=0;system(cls);break; default:system(cls);coutendlendlendlabcdefgh;if(car_n=a)return 1;return 0;/*刪
14、除車(chē)輛信息*void del()system(cls);string a,b,c,d,e,f,g,h;string line;string car_no;ifstream car(d:cars.txt);if(!car)cerrcars.txt cant open!endl;exit(1);ofstream temp(d:temp.txt);if(!temp)cerrtemp.txt cant open!endl;exit(1);int flag=1;while(flag)coutendlendl;coutttt*endl;coutttt1.刪除車(chē)輛信息endlendl;coutttt0.返回
15、上一菜單endl;coutttt*endl;coutn;switch(n)case 1:string car_n;coutendl;coutcar_n; if(judge1(car_n,line)=1)system(cls);coutendlendlendl;couttt存在這輛汽車(chē),確定要?jiǎng)h除?(y/n)endlendl; couttt請(qǐng)輸入您的選擇:endl;coutch;switch(ch)case y:while(getline(car,line)&flag1)string a,b,c,d,e,f,g,h;string line;string car_n;string car_no;c
16、outtt請(qǐng)?jiān)俅屋斎胍獎(jiǎng)h除的車(chē)輛的車(chē)牌號(hào):endl;coutcar_n;ifstream car(d:cars.txt);ofstream temp(d:tem.txt);while(getline(car,line)istringstream is(line);isabcdefgh;if(!car)cout您要的信息不存在;if(car_n!=a)tempsetiosflags(ios:left)a b c d e f g habcdefgh;car1setiosflags(ios:left) setw(20) a b c d e f g hendl; ofstream temp2(d:te
17、m.txt,ios:trunc);temp2.close();car.close();car1.close();temp.close();temp1.close();system(cls);coutendlendlttt信息已成功刪除!endlendl;flag1=0;break;case n:system(cls);continue;break;default:system(cls);coutendlendlendlttt輸入錯(cuò)誤!請(qǐng)重新輸入!;/+else system(cls); cout endlendl ttt沒(méi)有這輛車(chē)的信息!endlendl; break;break;case 0
18、:flag=0;break;default:system(cls);coutendlendlendlttt輸入錯(cuò)誤!請(qǐng)重新輸入!;car.close ();temp.close(); /*修改車(chē)輛信息*void modify()system(cls);string a,b,c,d,e,f,g,h;string line;string car_n;coutendl;ifstream car(d:cars.txt);if(!car)cerrcars.txt cant open!endl;exit(1);ofstream temp(d:tem.txt);if(!temp)cerrtem.txt ca
19、nt open!endl;exit(1);int flag=1,flag1=1;while(flag)coutendlendl;coutttt*endl;coutttt1.修改車(chē)輛信息endlendl;coutttt0.返回上一菜單endl;coutttt*endl;coutn;switch(n)case 1:string car_n;coutendl;coutttt請(qǐng)輸入要修改的汽車(chē)號(hào)碼:endl;coutcar_n; if(judge1(car_n,line)=1)system(cls);coutendlendlendl;couttt存在這輛汽車(chē),確定修改?(y/n)endl; coutt
20、t請(qǐng)輸入您的選擇:endl;coutch;switch(ch)case y:while(getline(car,line)&flag1)string a,b,c,d,e,f,g,h;string line;string car_n;string car_no;couttt請(qǐng)?jiān)俅屋斎胍薷牡能?chē)輛的車(chē)牌號(hào):endl;coutcar_n;ifstream car(d:cars.txt);ofstream temp(d:tem.txt);while(getline(car,line)istringstream is(line);isabcdefgh;if(!car)cout您要的信息不存在;if(ca
21、r_n!=a)tempsetiosflags(ios:left)a b c d e f g habcdefgh;car1setiosflags(ios:left) setw(20) a b c d e f g hendl; ofstream temp2(d:tem.txt,ios:trunc);temp2.close();temp.close();temp1.close();system(cls);coutendl;couttt請(qǐng)按提示重新輸入車(chē)輛信息:endlendl;couta;coutendl;coutb;coutendl;coutc;coutendl;coutd;coutendl;co
22、ute;coutendl;coutf;coutendl;coutg;coutendl;couth;coutendl;car1 setiosflags(ios:left)a b c d e f g hendl;system(cls);cout endl tt新信息錄入完成! endl endl;system(pause);break;car.close();car1.close();flag1=0;break;case n:system(cls);continue;break;default:system(cls);coutendlendlendlttt輸入錯(cuò)誤!請(qǐng)重新輸入!;/+else sy
23、stem(cls); cout endlendl ttt沒(méi)有該輛車(chē)的信息!endlendl; break;break;case 0:flag=0;break;default:system(cls);coutendlendlendlttt輸入錯(cuò)誤!請(qǐng)重新輸入!;car.close();temp.close();/*增加車(chē)輛修理單信息*void add_list()system(cls);string a,b,c,d,e,f;string line;ofstream car_list(d:cars_list.txt, ios:app); if(!car_list)cerropen error!en
24、dl;exit(1);int flag=1;while(flag)coutendlendl;coutttt*endl;coutttt1.增加車(chē)輛修理單信息endlendl;coutttt0.返回上一菜單endl;coutttt*endl;coutn;switch(n)case 1:system(cls);coutendl;coutt請(qǐng)按提示輸入車(chē)輛修理單信息:endlendl;couta;coutendl;coutb;coutendl;coutc;coutendl;coutd;coutendl;coute;coutendl;coutf;coutendl;car_list setiosflags
25、(ios:left)a b c d e fendl;system(cls);cout endl tt修理單信息錄入完成! endl endl;system(pause);break;case 0:flag=0;system(cls);break; default:system(cls);coutendlendlendlabcdef;if(list_n=a)return 1;return 0;/*刪除車(chē)輛修理單信息*void dele_list()system(cls);string a,b,c,d,e,f;string line;string list_no;ifstream car_list
26、(d:cars_list.txt);if(!car_list)coutendlendlendl;cerrtttcar_list.txt cant open!;exit(1);ofstream temp(d:tem.txt);if(!temp)cerrtem.txt cant open!endl;exit(1);int flag=1;while(flag)coutendlendl;coutttt*endl;coutttt1.刪除車(chē)輛修理單信息endlendl;coutttt0.返回上一菜單endl;coutttt*endl;coutn;switch(n)case 1:string list_n;
27、coutendl;coutttt請(qǐng)輸入要?jiǎng)h除的修理單編號(hào):endl;coutlist_n; if(judge2(list_n,line)=1)system(cls);coutendlendlendl;couttt存在這張修理單,確定要?jiǎng)h除?(y/n)endlendl; couttt請(qǐng)輸入您的選擇:endl;coutch;switch(ch)case y:while(getline(car_list,line)&flag1)string a,b,c,d,e,f;string line;string list_n;couttt請(qǐng)?jiān)俅屋斎胍獎(jiǎng)h除的修理單編號(hào):endl;coutlist_n;ifstr
28、eam car_list(d:cars_list.txt);/coutabcdef;if(!car_list)cout您要的信息不存在;if(list_n!=a)tempsetiosflags(ios:left)a b c d e fabcdef;car_list1setiosflags(ios:left)a b c d e fendl; ofstream temp2(d:temp.txt,ios:trunc);temp2.close();car_list1.close();car_list.close();temp.close();temp1.close();system(cls);cout
29、endlendlttt信息已成功刪除!endlendl;flag1=0;break;case n:system(cls);continue;break;default:system(cls);coutendlendlendlttt輸入錯(cuò)誤!請(qǐng)重新輸入!;else system(cls); coutendlendlttt沒(méi)有這修理單的信息!endlendl; break;break;case 0:flag=0;break;default:system(cls);coutendlendlendlttt輸入錯(cuò)誤!請(qǐng)重新輸入!;car_list.close();temp.close();/*修改車(chē)輛修
30、理單信息*void modify_list()system(cls);string a,b,c,d,e,f,g;string line;string car_n;coutendl;ifstream car(d:cars_list.txt);if(!car)cerrcars_list.txt cant open!endl;exit(1);ofstream temp(d:temp.txt);if(!temp)cerrtemp.txt cant open!endl;exit(1);int flag=1,flag1=1;while(flag)coutendlendl;coutttt*endl;coutttt1.修改修理單信息endlendl;coutttt0.返回上一菜單endl;coutttt*endl;coutn;switch(n)case 1:string car_n;coutendl;coutttt請(qǐng)輸入要修改的修理單編號(hào):endl;coutcar_n; if(judge2(car_n,line)=1)system(cls);coutendlendlendl;couttt存在這修理單,確定修改?(y/n)endlendl; couttt請(qǐng)輸入您的選擇:endl;coutch;switch(ch)case y:while(g
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025-2030年中國(guó)鎂錳電池市場(chǎng)規(guī)模分析及發(fā)展建議研究報(bào)告
- 2025-2030年中國(guó)辣椒制品行業(yè)運(yùn)行動(dòng)態(tài)與投資戰(zhàn)略研究報(bào)告
- 2025-2030年中國(guó)蒿甲醚行業(yè)市場(chǎng)現(xiàn)狀調(diào)研與前景規(guī)模預(yù)測(cè)報(bào)告
- 2025-2030年中國(guó)自動(dòng)高壓蒸汽滅菌器市場(chǎng)發(fā)展?fàn)顩r及前景趨勢(shì)分析報(bào)告
- 2025-2030年中國(guó)育發(fā)水市場(chǎng)發(fā)展?fàn)顩r及投資規(guī)劃研究報(bào)告
- 2025安全員-C證考試題庫(kù)
- 2025-2030年中國(guó)糯玉米汁飲料市場(chǎng)發(fā)展預(yù)測(cè)及前景調(diào)研分析報(bào)告
- 2025-2030年中國(guó)粉針類(lèi)頭孢制劑行業(yè)需求分析與十三五規(guī)劃研究報(bào)告
- 2025-2030年中國(guó)移動(dòng)電源車(chē)產(chǎn)業(yè)運(yùn)行動(dòng)態(tài)及前景趨勢(shì)預(yù)測(cè)報(bào)告
- 2025-2030年中國(guó)石棉板行業(yè)運(yùn)行態(tài)勢(shì)及投資戰(zhàn)略研究報(bào)告
- 四川省公務(wù)員考試行測(cè)真題
- 2024年廣東省初中學(xué)業(yè)水平考試中考英語(yǔ)試卷(真題+答案解析)
- DL-T-255-2012燃煤電廠能耗狀況評(píng)價(jià)技術(shù)規(guī)范
- 家庭教育家長(zhǎng)會(huì)教案及反思(3篇模板)
- 職業(yè)培訓(xùn)師三級(jí)操作技能鑒定卷庫(kù)及答案
- 【視頻號(hào)運(yùn)營(yíng)】視頻號(hào)運(yùn)營(yíng)108招
- 新能源客車(chē)安全應(yīng)急處理指南
- (正式版)JTT 421-2024 港口固定式起重機(jī)安全要求
- 地連墻施工MJS工法樁施工方案
- 《電力建設(shè)施工技術(shù)規(guī)范 第2部分:鍋爐機(jī)組》DLT 5190.2
- 教案設(shè)計(jì)常見(jiàn)問(wèn)題及解決措施
評(píng)論
0/150
提交評(píng)論