版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、C+編寫倉(cāng)庫(kù)管理系統(tǒng)/functions.h#include #include #include #include #include #include using namespace std;void denglu();void choice();void zhuce();char first_face();void in_storage();void select_time();void out_storage();void select_ele();void select_name();void select_kind();void select_all();void call();voi
2、d denglu() string username1,passport1,name1;string username,passport;ifstream storeFile(userdate.txt);if(!storeFile)coutnnt對(duì)不起,用戶文件丟失。nnt;system(pause);return; cout用戶登錄:endl;coutusername; coutpassport;bool flag=false;while(storeFileusername1passport1name1)if(username1=username&passport1=passport)fla
3、g=true; system(cls);cout登錄成功!endl;cout歡迎您,name1_endl;system(pause);else if(username1=username|passport1=passport)cout用戶名或密碼錯(cuò)誤!endl;denglu();storeFile.close();call();choice();void choice()char a;a=first_face(); while(1) switch(a) case 1:in_storage();break; case 2:out_storage();break; case 3:select_el
4、e();break; case 4:system(cls);coutt謝謝您的使用!nntt; exit(0); break; default:break; char first_face()system(cls);/系統(tǒng)清屏cout=endl;cout* *endl;cout* 倉(cāng) 庫(kù) 管 理 系 統(tǒng) *endl;cout* *endl;cout* 1. 商品入庫(kù) *endl;cout* *endl;cout* 2. 商品出庫(kù) *endl;cout* *endl;cout* 3. 商品查詢 *endl;cout* *endl;cout* 4. 退出系統(tǒng) *endl;cout* *endl;c
5、out=endl;return getch();/入庫(kù)void in_storage()system(cls);/系統(tǒng)清屏string name;/商品名double price;/價(jià)格string storeNo;/倉(cāng)庫(kù)編號(hào)string kinds;/商品大類string shelfNo;/貨架號(hào)long count=0;/商品數(shù)量string time;/入庫(kù)時(shí)間coutn;cout商品入庫(kù),請(qǐng)輸入相關(guān)信息:;coutendlname;coutendlprice;coutendlcount;coutendlstoreNo;coutendlkinds;coutendlshelfNo;cout
6、endltime;ofstream storeFile(store.txt, ios:app);storeFilesetiosflags(ios:left)setw(20)name setw(15)price setw(10)count setw(10) storeNo setw(20)kinds shelfNo setw(20)timeendl;storeFile.close();coutnnt該商品已經(jīng)入庫(kù)nnt;cout是否繼續(xù)?1.是 2.否a;if(a=1)in_storage();if(a=2)first_face();choice();system(pause);/系統(tǒng)暫停/ 出
7、庫(kù)void out_storage()system(cls);/系統(tǒng)清屏string name;/商品名coutendlt商品出庫(kù),輸入出庫(kù)商品信息:endl;coutname;ifstream storeFile(store.txt);if(!storeFile)ofstream storeFile1(store.txt);storeFile1.close();coutnnt庫(kù)存為空nnt; cout是否繼續(xù)?1.是 2.否a; if(a=1)in_storage(); else if(a=2)first_face();choice();bool flag=false;string name
8、1;/商品名double price1;/價(jià)格string storeNo1;/倉(cāng)庫(kù)編號(hào)string kinds1;/商品大類string shelfNo1;/貨架號(hào)long count1=0;/商品數(shù)量ofstream tempFile(temp.txt);while(storeFilename1price1count1storeNo1kinds1shelfNo1)if(name1=name)flag=true;elsetempFilesetiosflags(ios:left)setw(20)name1 setw(15)price1 setw(10)count1 setw(10)storeN
9、o1 setw(20)kinds1 shelfNo1endl;tempFile.close();storeFile.close();if(!flag)coutnnt倉(cāng)庫(kù)中沒(méi)有該商品!nnt;system(pause);return;ofstream storeFile1(store.txt);ifstream tempFile1(temp.txt);storeFile1tempFile1.rdbuf();storeFile1.close();tempFile1.close();coutnt這些商品已經(jīng)出庫(kù),請(qǐng)仔細(xì)檢查!nnt;cout是否繼續(xù)?1.是 2.否a;if(a=1)out_stora
10、ge();if(a=2)first_face();choice();system(pause);/查詢void select_ele()while (1)system(cls);coutnendl;coutt=endltendlt 商 品 查 詢endltendlt1. 按商品名稱查詢endltendlt2. 按入庫(kù)時(shí)間查詢endltendlt3. 查看所有商品endltendlt4. 按商品大類查詢endltendlt5. 返回endltendlt=endl;coutntt;char select=getch();switch(select) case 1:select_name();bre
11、ak; case 2:select_time();break;case 3:select_all();break;case 4:select_kind();break; case 5:first_face();choice();break; default:break;/按商品名稱查詢void select_name()system(cls);coutendlt按商品名查詢:endl;coutname;string name1;/商品名string time1;double price1;/價(jià)格string storeNo1;/倉(cāng)庫(kù)編號(hào)string kinds1;/商品大類string she
12、lfNo1;/貨架號(hào)long count1=0;/商品數(shù)量ifstream storeFile(store.txt);if(!storeFile)coutnnt對(duì)不起,你的庫(kù)存為空nnt;system(pause);return;bool flag=false;coutn商品名 價(jià)格 商品數(shù)量 倉(cāng)庫(kù)編號(hào) 商品大類 貨架號(hào) 入庫(kù)時(shí)間name1price1count1storeNo1kinds1shelfNo1time1)if(name1=name)flag=true;coutsetiosflags(ios:left) name1 price1 count1 storeNo1 kinds1 she
13、lfNo1 time1endl;storeFile.close();if(!flag)coutnn對(duì)不起,庫(kù)存中沒(méi)有這個(gè)商品;coutnendl;system(pause);void select_time()/按入庫(kù)時(shí)間查詢system(cls);coutnt按入庫(kù)時(shí)間查詢:endl ;couttime;string name1;/商品名double price1;/價(jià)格string storeNo1;/倉(cāng)庫(kù)編號(hào)string kinds1;/商品大類string shelfNo1;/貨架號(hào)string time1;long count1=0;/商品數(shù)量ifstream storeFile(s
14、tore.txt);if(!storeFile)coutnnt對(duì)不起,你的庫(kù)存為空nnt;system(pause);return;bool flag=false;coutn商品名 setw(15)價(jià)格 setw(10)商品數(shù)量 setw(10)倉(cāng)庫(kù)編號(hào) setw(10)商品大類 setw(15)貨架號(hào)nname1price1count1storeNo1kinds1shelfNo1time1)if (time1=time)flag=true;coutsetiosflags(ios:left)setw(15)name1 setw(10)price1 setw(10)count1 setw(10)
15、storeNo1 setw(15)kinds1 shelfNo1endl;storeFile.close();if(!flag)coutnn對(duì)不起,倉(cāng)庫(kù)中沒(méi)有這類商品!; coutnendl;system(pause);void select_all()/查看所有商品system(cls);string name1;/商品名string time1;/入庫(kù)時(shí)間double price1;/價(jià)格string storeNo1;/倉(cāng)庫(kù)編號(hào)string kinds1;/商品大類string shelfNo1;/貨架號(hào)long count1=0;/商品數(shù)量ifstream storeFile(stor
16、e.txt);if(!storeFile)coutnnt對(duì)不起,你的庫(kù)存為空nnt;system(pause);return;bool flag=false;coutn商品名 價(jià)格 商品數(shù)量 倉(cāng)庫(kù)編號(hào) 商品大類 貨架號(hào) 入庫(kù)時(shí)間name1price1count1storeNo1kinds1shelfNo1time1)flag=true;coutsetiosflags(ios:left) name1 price1 count1 storeNo1 kinds1 shelfNo1 time1endl;storeFile.close();system(pause);/按大類查詢void select_
17、kind()system(cls);coutnt按商品大類查詢:endl ;coutkinds;string name1;/商品名double price1;/價(jià)格string storeNo1;/倉(cāng)庫(kù)編號(hào)string kinds1;/商品大類string shelfNo1;/貨架號(hào)string time1;/入庫(kù)時(shí)間long count1=0;/商品數(shù)量ifstream storeFile(store.txt);if(!storeFile)coutnnt對(duì)不起,你的庫(kù)存為空nnt;system(pause);return;bool flag=false;coutn商品名 價(jià)格 商品數(shù)量 倉(cāng)庫(kù)
18、編號(hào) 商品大類 貨架號(hào) 入庫(kù)時(shí)間name1price1count1storeNo1kinds1shelfNo1time1)if (kinds1=kinds)flag=true;coutsetiosflags(ios:left)setw(15)name1 setw(10)price1 setw(10)count1 setw(10)storeNo1 setw(15)kinds1 shelfNo1 setw(15)time1endl;storeFile.close();if(!flag)coutnn對(duì)不起,庫(kù)存中沒(méi)有這類商品;coutnendl;system(pause);void zhuce()s
19、ystem(cls);/系統(tǒng)清屏string username,passport,passport1,name,miyao,jiami; coutusername;coutpassport; coutpassport1;if(passport=passport1)coutname; else if(passport!=passport1)cout兩次輸入的密碼不一致,請(qǐng)重新輸入!endl;while(passport!=passport1)coutpassport; coutpassport1;coutname;ofstream storeFile(userdate.txt, ios:app);storeFilesetiosflags(ios:left)setw(15)username setw(15)passport setw(10)nameendl;storeFile.close();system(cls);cout賬戶創(chuàng)建成功!歡迎您,nameendl;system(pause);system(cls);first_face();choice();void call()/提醒功能system(cls);ifstream storeFile(s
溫馨提示
- 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ī)療健康領(lǐng)域的成長(zhǎng)探索
- 銀行私行業(yè)務(wù)與對(duì)沖基金的跨界合作案例分析
- 小學(xué)音樂(lè)教育與孩子情緒管理的關(guān)系研究
- 食品安全知識(shí)普及學(xué)校教育的責(zé)任與擔(dān)當(dāng)
- 社交媒體對(duì)學(xué)生聚會(huì)啤酒消費(fèi)的影響研究
- 傳統(tǒng)工藝與現(xiàn)代設(shè)計(jì)在家用紡織品中的融合
- 2025年許昌電氣職業(yè)學(xué)院高職單招職業(yè)技能測(cè)試近5年常考版參考題庫(kù)含答案解析
- 2025年西安航空職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測(cè)試近5年常考版參考題庫(kù)含答案解析
- 2024年炊事設(shè)備項(xiàng)目資金申請(qǐng)報(bào)告代可行性研究報(bào)告
- 2025年蘇州高博軟件技術(shù)職業(yè)學(xué)院高職單招語(yǔ)文2018-2024歷年參考題庫(kù)頻考點(diǎn)含答案解析
- 聚焦幼兒作品分析的游戲觀察與評(píng)價(jià)
- 開龍IT2021使用手冊(cè)
- 胸外科手術(shù)圍手術(shù)期處理
- 《企業(yè)管理課件:團(tuán)隊(duì)管理知識(shí)點(diǎn)詳解PPT》
- 配網(wǎng)設(shè)備缺陷分類及管理重點(diǎn)標(biāo)準(zhǔn)
- 反腐倡廉廉潔行醫(yī)
- UI與交互設(shè)計(jì)人機(jī)交互設(shè)計(jì)(第二版)PPT完整全套教學(xué)課件
- GMS要素-持續(xù)改進(jìn)(CI)-上汽通用五菱-課件
- 《插畫設(shè)計(jì)》課程標(biāo)準(zhǔn)
- 高考作文答題卡(作文)
- 在鄉(xiāng)村治理中深化推廣運(yùn)用清單制、積分制、一張圖工作方案
評(píng)論
0/150
提交評(píng)論