




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、文檔供參考,可復(fù)制、編制,期待您的好評與關(guān)注! #include "stdafx.h"#include <fstream>#include <iostream>#include <string>#include "time.h"using namespace std;void getinfo(); /獲取文件信息void shenfen(); /第二個頁面:選擇身份void kehu01(); /客戶第一個頁面void kehu02(); /客戶第二個頁面:服務(wù)頁面void yewu01(); /業(yè)務(wù)員第一個頁面voi
2、d yewu_fw(); /業(yè)務(wù)員第二個頁面:服務(wù)頁面void yewu_xs(); /業(yè)務(wù)員第三個頁面:銷售車輛void yewu_xx(); /業(yè)務(wù)員第四個頁面:客戶信息頁面void baoyang(); /業(yè)務(wù)員第五個頁面:此次保養(yǎng)頁面void fen(); /評分函數(shù)void getinfo(); /獲取文件信息void saveinfo(); /保存信息class Carpublic:int carnumber;string type;int buyyear;int buymonth;int buyday;int salenumber;car100;class Customerpub
3、lic:string name;int phonenumber;string sex;int salenumber;customer100;class CarServicepublic:int waxes;/表面打蠟int lub;/換潤滑油int water;/電瓶加水int locate;/四輪定位int estimate;/評價int serviceyear;int servivemonth;int serviceday;int salenumber;carService100;class SaleManpublic:int salenumber;int num;saleMan100;v
4、oid getinfo()/獲取文件信息ifstream customertxt("customer.txt",ios:in);ifstream cartxt("car.txt",ios:in);ifstream carservicetxt("carservice.txt",ios:in);ifstream salemantxt("saleman.txt",ios:in);while(!customertxt)cout<<"無法打開customer.txt文件"<<end
5、l;exit(1);while(!cartxt)cout<<"無法打開car.txt文件"<<endl;exit(1);while(!carservicetxt)cout<<"無法打開carservice.txt文件"<<endl;exit(1);while(!salemantxt)cout<<"無法打開saleman.txt文件"<<endl;exit(1);int i=0;while(customertxt>>customeri.salenumbe
6、r>>>>customeri.phonenumber>>customeri.sex)i+;i=0;while(cartxt>>cari.salenumber>>cari.carnumber>>cari.type>>cari.buyyear>>cari.buymonth>>cari.buyday)i+;i=0;while(carservicetxt>>carServicei.salenumber>>carServicei.waxes>
7、;>carServicei.lub>>carServicei.water>>carServicei.locate>>carServicei.estimate>>carServicei.serviceyear>>carServicei.servivemonth>>carServicei.serviceday)i+;i=0;while(salemantxt>>saleMani.salenumber>>saleMani.num)i+;customertxt.close();cartxt.close(
8、);carservicetxt.close();salemantxt.close();void shenfen() /第二個頁面:選擇身份cout<<"="<<endl;cout<<"| 歡迎您進入本4S店管理系統(tǒng) |"<<endl;cout<<"| 請選擇您的身份: |"<<endl;cout<<"| 1.本店客戶 |"<<endl;cout<<"| 2.業(yè)務(wù)員 |"<<en
9、dl;cout<<"| 3.退出管理系統(tǒng) |"<<endl;cout<<"="<<endl; int a;cout<<"您的選擇是:"for(int i=0;i+) cin>>a;if(a=1)kehu01();break;else if(a=2)yewu01();break; else if(a=3)cout<<"歡迎使用本系統(tǒng),謝謝您的光臨!"<<endl;exit(1); else cout<<&quo
10、t;輸入錯誤!請從新輸入!"<<"n"<<"您的選擇是:"<<endl;void kehu01() /客戶第一個頁面cout<<"="<<endl;cout<<"| 尊敬的客戶,請選擇服務(wù)項目: |"<<endl;cout<<"| 1.輸入車牌號碼 |"<<endl;cout<<"| 2.返回上一級 |"<<endl;cout<&
11、lt;"| 3.退出管理系統(tǒng) |"<<endl; cout<<"="<<endl; int a;cout<<"您的選擇是:"for(int i=0;i+) cin>>a;if(a=1)kehu02();break;else if(a=2)shenfen();break; else if(a=3)cout<<"歡迎使用本系統(tǒng),謝謝您的光臨!"<<endl;exit(1); else cout<<"輸入錯誤!請從新
12、輸入!"<<"n"<<"您的選擇是:"<<endl;void kehu02() /客戶第二個頁面:服務(wù)頁面int a,b,c,i,j,k=0;cout<<"請輸入您的車牌號碼:"AB:cin>>a;for(i=0;i<100;i+)if(a=cari.carnumber) break;else k+;if(k=100)cout<<"您輸入的車牌號碼有誤,請重新輸入:" goto AB;cout<<"=&qu
13、ot;<<endl;cout<<"| 尊敬的客戶,請選擇服務(wù)項目: |"<<endl; cout<<"| 1.查詢車輛信息 |"<<endl;cout<<"| 2.查詢上次保養(yǎng)信息 |"<<endl;cout<<"| 3.此次保養(yǎng)評價 |"<<endl;cout<<"| 4.返回上一級 |"<<endl;cout<<"| 5.退出管理系統(tǒng) |&
14、quot;<<endl; cout<<"="<<endl;cout<<"您的選擇是:"for(j=0;j+)BB:cin>>b;if(b=1)cout<<endl;cout<<"您購買汽車的型號為:"<<cari.type<<endl;cout<<"您購買的日期為:"<<cari.buyyear<<"年"<<cari.buymonth<
15、<"月"<<cari.buyday<<"日"<<endl;cout<<"繼續(xù)查詢請輸入1,退出請輸入0:"QQ2:cin>>c;if(c=1) kehu02();else if(c=0) exit(1);else cout<<"輸入錯誤,請重新輸入:" goto QQ2;else if(b=2)cout<<endl;cout<<"上次保養(yǎng)時間為:"<<carServicei.serv
16、iceyear<<"年"<<carServicei.servivemonth<<"月"<<carServicei.serviceday<<"日"<<endl;cout<<"上次保養(yǎng)的項目有:"if(carServicei.waxes=1)cout<<"表面打蠟"<<"t"if(carServicei.lub=1)cout<<"換潤滑油"&
17、lt;<"t"if(carServicei.water=1)cout<<"電瓶加水"<<"t"if(carServicei.locate=1)cout<<"四輪定位"<<"t"cout<<endl;cout<<"您上次對業(yè)務(wù)員的評價為:"<<carServicei.estimate<<"分"<<endl;cout<<"繼續(xù)
18、查詢請輸入1,退出請輸入0:"QQ1:cin>>c;if(c=1) kehu02();else if(c=0) exit(1);else cout<<"輸入錯誤,請重新輸入:" goto QQ1;else if(b=3)int d;cout<<"請選擇您對業(yè)務(wù)員的評分"<<endl;cout<<"1分:很不滿意"<<endl;cout<<"2分:不滿意"<<endl;cout<<"3分:一
19、般"<<endl;cout<<"4分:滿意"<<endl;cout<<"5分:很滿意"<<endl;cout<<"您對此次保養(yǎng)的評價為:"DD:cin>>d;if(d=1|d=2|d=3|d=4|d=5)cout<<"謝謝您的評價!"<<endl;carServicei.estimate=d;elsecout<<"輸入錯誤!請從新輸入:"goto DD;cout<
20、;<"繼續(xù)查詢請輸入1,退出請輸入0:"QQ:cin>>c;if(c=1) kehu02();else if(c=0) exit(1);else cout<<"輸入錯誤,請重新輸入:" goto QQ; else if(b=4)kehu01();break; else if(b=5)cout<<endl;cout<<"歡迎使用本系統(tǒng),謝謝您的光臨!"<<endl;exit(1);else cout<<"輸入錯誤!請從新輸入:" goto
21、BB;void yewu01() /業(yè)務(wù)員第一個頁面cout<<"="<<endl;cout<<"| 業(yè)務(wù)員,您好,請選擇服務(wù)項目: |"<<endl;cout<<"| 1.輸入業(yè)務(wù)員編號 |"<<endl;cout<<"| 2.返回上一級 |"<<endl;cout<<"| 3.退出管理系統(tǒng) |"<<endl; cout<<"="<<
22、;endl; int a;cout<<"您的選擇是:"for(int i=0;i+) cin>>a;if(a=1)yewu_fw();break;else if(a=2)shenfen();break; else if(a=3)cout<<"歡迎使用本系統(tǒng),謝謝您的光臨!"<<endl;exit(1); else cout<<"輸入錯誤!請從新輸入!"<<"n"<<"您的選擇是:"<<endl;voi
23、d yewu_fw() /業(yè)務(wù)員第二個頁面:服務(wù)頁面int a,b,c,i,j,l,k=0;cout<<"請輸入您的工作編號:"AB:cin>>a;for(i=0;i<5;i+)if(a=saleMani.salenumber) break;else k+;if(k=5)cout<<"您輸入的工作編號有誤,請重新輸入:" goto AB; cout<<"="<<endl;cout<<"| 業(yè)務(wù)員,您好,請選擇服務(wù)項目: |"<<
24、;endl; cout<<"| 1.查詢所銷售的所有車輛 |"<<endl;cout<<"| 2.輸入車牌號,查詢信息 |"<<endl;cout<<"| 3.輸入車牌號,更新保養(yǎng)信息 |"<<endl;cout<<"| 4.出售車輛 |"<<endl;cout<<"| 5.銷售額查詢 |"<<endl;cout<<"| 6.返回上一級 |"&l
25、t;<endl;cout<<"| 7.退出管理系統(tǒng) |"<<endl; cout<<"="<<endl;cout<<"您的選擇是:"for(j=0;j+) cin>>b;if(b=1)cout<<endl;cout<<"車牌號碼"<<"t"<<"型號"<<"t"<<"銷售日期"<&l
26、t;endl;for(l=0;l<100;l+)if(saleMani.salenumber=carl.salenumber)cout<<carl.carnumber<<"tt"<<carl.type<<"t"<<carl.buyyear<<"."<<carl.buymonth<<"."<<carl.buyday<<endl;cout<<"繼續(xù)查詢請輸入1,退出請輸入0
27、:"QQ1:cin>>c;if(c=1)yewu_fw();else if(c=0) exit(1);else cout<<"輸入錯誤,請重新輸入:" goto QQ1;else if(b=2)yewu_xx();break; else if(b=4)yewu_xs();break;else if(b=3)baoyang();break; else if(b=5)cout<<"業(yè)務(wù)員編號"<<"t"<<"銷售總量"<<"t&
28、quot;<<endl;for(int m=0;m<5;m+)if(saleManm.salenumber)cout<<saleManm.salenumber<<"tt"<<saleManm.num<<endl;cout<<"繼續(xù)查詢請輸入1,退出請輸入0:"QQ2:cin>>c;if(c=1)yewu_fw();else if(c=0) exit(1);else cout<<"輸入錯誤,請重新輸入:" goto QQ2; else
29、if(b=6)yewu01();break; else if(b=7)cout<<"歡迎使用本系統(tǒng),謝謝您的光臨!"<<endl;exit(1); else cout<<"輸入錯誤!請從新輸入!"<<"n"<<"您的選擇是:"<<endl;void yewu_xs() /業(yè)務(wù)員第三個頁面:銷售車輛cout<<"="<<endl;cout<<"| 業(yè)務(wù)員,您好,此為銷售車輛頁面:
30、|"<<endl;cout<<"| 1.輸入客戶信息 |"<<endl;cout<<"| 2.返回上一級 |"<<endl;cout<<"| 3.退出管理系統(tǒng) |"<<endl; cout<<"="<<endl; int a,b;time_t timep; struct tm *p; time(&timep); p=localtime(&timep); /取得當(dāng)?shù)貢r間cout<
31、<"您的選擇是:"<<endl;for(int i=0;i+)AB:cin>>a;if(a=1)int carnumber;string cartype;string name;string sex;int phonenumber;int salenumber;int j;cout<<"請依次輸入客戶信息:"<<endl;cout<<"車牌號碼:"cin>>carnumber;cout<<endl;cout<<"車輛型號:&
32、quot;cin>>cartype;cout<<endl;cout<<"客戶姓名:"cin>>name;cout<<endl;cout<<"客戶性別:"cin>>sex;cout<<endl;cout<<"客戶電話:"cin>>phonenumber;cout<<endl;cout<<"業(yè)務(wù)員編號:"cin>>salenumber;for(j=0;j<10
33、0;j+)if(!carj.carnumber) break;carj.carnumber=carnumber;carj.salenumber=salenumber;carj.type=cartype;=name;customerj.sex=sex;customerj.phonenumber=phonenumber;customerj.salenumber=salenumber;carj.salenumber=salenumber;carj.buyyear=1900+p->tm_year;carj.buymonth=1+p->tm_mon;carj.bu
34、yday=p->tm_mday;carServicej.salenumber=salenumber;carServicej.waxes=0;carServicej.water=0;carServicej.locate=0;carServicej.lub=0;carServicej.estimate=0;carServicej.serviceyear=1900+p->tm_year;carServicej.servivemonth=1+p->tm_mon;carServicej.serviceday=p->tm_mday;for(int k=0;k<5;k+)if(
35、saleMank.num)if(saleMank.salenumber=salenumber)saleMank.num+;saveinfo();cout<<"信息輸入完畢"<<endl;cout<<"返回上一級請輸入1,退出請輸入0:"QQ:cin>>b; if(b=1)yewu_fw();else if(b=0) exit(1);else cout<<"輸入錯誤,請重新輸入:"goto QQ;else if(a=2)yewu_fw();break; else if(a=3)
36、cout<<"歡迎使用本系統(tǒng),謝謝您的光臨!"<<endl;exit(1);elsecout<<"輸入錯誤!請從新輸入!"<<"n"<<"您的選擇是:"goto AB;void yewu_xx() /業(yè)務(wù)員第四個頁面:客戶信息頁面int a,b,c,i,j,k=0;cout<<"請輸入車牌號碼:"AB:cin>>a;for(i=0;i<100;i+)if(a=cari.carnumber) break;el
37、se k+;if(k=100)cout<<"您輸入的車牌號碼有誤,請重新輸入:" goto AB;cout<<"="<<endl;cout<<"| 業(yè)務(wù)員,您好,請選擇你要查詢的資料: |"<<endl;cout<<"| 1.客戶信息 |"<<endl;cout<<"| 2.車輛信息 |"<<endl;cout<<"| 3.上次保養(yǎng)服務(wù) |"<<
38、endl;cout<<"| 4.返回上一級 |"<<endl;cout<<"| 5.退出管理系統(tǒng) |"<<endl; cout<<"="<<endl;cout<<"您的選擇是:"for(j=0;j+) cin>>b; if(b=1)cout<<endl;cout<<"客戶姓名"<<"t"<<"客戶性別"<&l
39、t;"t"<<"客戶電話"<<endl;cout<<<<"tt"<<customeri.sex<<"tt"<<customeri.phonenumber<<endl;cout<<"繼續(xù)查詢請輸入1,退出請輸入0:"QQ1:cin>>c;if(c=1) yewu_xx();else if(c=0) exit(1);else cout<<&q
40、uot;輸入錯誤,請重新輸入:" goto QQ1;else if(b=2)cout<<endl;cout<<"車輛型號"<<"t"<<"購買日期"<<endl;cout<<cari.type<<"tt"<<cari.buyyear<<"."<<cari.buymonth<<"."<<cari.buyday<<e
41、ndl;cout<<"繼續(xù)查詢請輸入1,退出請輸入0:"QQ2:cin>>c;if(c=1) yewu_xx();else if(c=0) exit(1);else cout<<"輸入錯誤,請重新輸入:" goto QQ2; else if(b=3)cout<<endl;cout<<"上次保養(yǎng)時間為:"<<carServicei.serviceyear<<"."<<carServicei.servivemonth<
42、<"."<<carServicei.serviceday<<endl;cout<<"上次保養(yǎng)的項目有:"if(carServicei.waxes=1)cout<<"表面打蠟"<<"t"if(carServicei.lub=1)cout<<"換潤滑油"<<"t"if(carServicei.water=1)cout<<"電瓶加水"<<"
43、t"if(carServicei.locate=1)cout<<"四輪定位"<<"t"cout<<endl;cout<<"客服評分為:"cout<<carServicei.estimate<<"分"<<endl;/當(dāng)汽車離下次保養(yǎng)剩下一個月的時候提醒業(yè)務(wù)員time_t timep; struct tm *p; time(&timep); p=localtime(&timep); /取得當(dāng)?shù)貢r間int w,b
44、m;w=1+p->tm_mon;if(carj.buymonth>0&&carj.buymonth<10)if(carj.buymonth+3-w=1)cout<<"項目:"<<" "<<"離下一次保養(yǎng)只剩一個月了"<<endl;else if(carj.buymonth<13&&carj.buymonth>9)bm=carj.buymonth-9;if(bm<w)if(w-bm=1)cout<<"
45、項目:"<<" "<<"離下一次保養(yǎng)只剩一個月了"<<endl;elseif(bm-w=1)cout<<"項目:"<<" "<<"離下一次保養(yǎng)只剩一個月了"<<endl;cout<<"繼續(xù)查詢請輸入1,退出請輸入0:"QQ3:cin>>c;if(c=1) yewu_xx();else if(c=0) exit(1);else cout<<"
46、;輸入錯誤,請重新輸入:" goto QQ3; else if(b=4)yewu_fw();break; else if(b=5)cout<<"歡迎使用本系統(tǒng),謝謝您的光臨!"<<endl;exit(1); else cout<<"輸入錯誤!請從新輸入!"<<"n"<<"您的選擇是:"<<endl;void baoyang() /業(yè)務(wù)員第五個頁面:此次保養(yǎng)頁面int a,b,i,k=0;int d1,d2,d3,d4;cout<
47、<"請輸入車牌號碼:"AB:cin>>a;for(i=0;i<100;i+)if(a=cari.carnumber) break;else k+;if(k=100)cout<<"您輸入的車牌號碼有誤,請重新輸入:" goto AB;cout<<"業(yè)務(wù)員,您好,保養(yǎng)服務(wù)如下,如需保養(yǎng)此項目,請在后面輸入1,否則輸入0"<<endl;cout<<"1.表面打蠟:"D1:cin>>d1; if(d1!=1&&d1!=0)c
48、out<<"輸入錯誤,請重新輸入:"goto D1;carServicei.waxes=d1;D2:cout<<"2.換潤滑油:"cin>>d2; if(d2!=1&&d2!=0)cout<<"輸入錯誤,請重新輸入:"<<endl;goto D2;carServicei.lub=d2;D3:cout<<"3.電瓶加水:"cin>>d3;if(d3!=1&&d3!=0)cout<<"
49、;輸入錯誤,請重新輸入:"<<endl;goto D3;carServicei.water=d3;D4:cout<<"4.四輪定位:"cin>>d4;if(d4!=1&&d4!=0)cout<<"輸入錯誤,請重新輸入:"<<endl;goto D4;carServicei.locate=d4;cout<<endl;saveinfo();cout<<"信息輸入完畢,返回上一級請輸入1,退出請輸入0:"QQ:cin>>
50、b;if(b=1) yewu_fw();else if(b=0) exit(1);else cout<<"輸入錯誤,請重新輸入:" goto QQ;void saveinfo()ofstream customertxt("customer.txt",ios:out);ofstream cartxt("car.txt",ios:out);ofstream carservicetxt("carservice.txt",ios:out);ofstream salemantxt("saleman.txt",ios:out);for(int
溫馨提示
- 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 船舶保養(yǎng)考試題及答案
- 2025年軍隊文職人員招聘之軍隊文職法學(xué)考前沖刺試卷A卷含答案
- 小升初科學(xué)測試題及答案
- 2019-2025年消防設(shè)施操作員之消防設(shè)備基礎(chǔ)知識能力檢測試卷B卷附答案
- 2019-2025年消防設(shè)施操作員之消防設(shè)備基礎(chǔ)知識模考模擬試題(全優(yōu))
- 2019-2025年消防設(shè)施操作員之消防設(shè)備基礎(chǔ)知識基礎(chǔ)試題庫和答案要點
- 社保知識培訓(xùn)課件北京
- 語文小說文本解讀技巧訓(xùn)練教案:以小說圍城為例
- 辦公室人員基本信息表
- 寫作技巧大揭秘:高中語文作文指導(dǎo)課程教案
- 2025年共青科技職業(yè)學(xué)院單招職業(yè)適應(yīng)性測試題庫完整版
- 2025年上半年潛江市城市建設(shè)發(fā)展集團招聘工作人員【52人】易考易錯模擬試題(共500題)試卷后附參考答案
- 統(tǒng)編版語文二年級下冊15古詩二首 《曉出凈慈寺送林子方》公開課一等獎創(chuàng)新教學(xué)設(shè)計
- 旅游電子商務(wù)(第2版) 課件全套 周春林 項目1-8 電子商務(wù)概述-旅游電子商務(wù)數(shù)據(jù)挖掘
- 2025年安徽警官職業(yè)學(xué)院單招職業(yè)適應(yīng)性測試題庫帶答案
- 廣東廣東省錢幣學(xué)會招聘筆試歷年參考題庫附帶答案詳解
- 2025年福建省中職《英語》學(xué)業(yè)水平考試核心考點試題庫500題(重點)
- 【課件】自然環(huán)境課件-2024-2025學(xué)年七年級地理下冊人教版
- 2025年河北省職業(yè)院校技能大賽智能節(jié)水系統(tǒng)設(shè)計與安裝(高職組)考試題庫(含答案)
- 2025-2030年中國蒸發(fā)器冷凝器行業(yè)發(fā)展?fàn)顩r及前景趨勢分析報告
- 2024年江西環(huán)境工程職業(yè)學(xué)院高職單招語文歷年參考題庫含答案解析
評論
0/150
提交評論