綜合實(shí)驗(yàn)兒童商品倉(cāng)庫(kù)管理系統(tǒng)報(bào)告_第1頁(yè)
綜合實(shí)驗(yàn)兒童商品倉(cāng)庫(kù)管理系統(tǒng)報(bào)告_第2頁(yè)
綜合實(shí)驗(yàn)兒童商品倉(cāng)庫(kù)管理系統(tǒng)報(bào)告_第3頁(yè)
綜合實(shí)驗(yàn)兒童商品倉(cāng)庫(kù)管理系統(tǒng)報(bào)告_第4頁(yè)
綜合實(shí)驗(yàn)兒童商品倉(cāng)庫(kù)管理系統(tǒng)報(bào)告_第5頁(yè)
已閱讀5頁(yè),還剩34頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

西南交通大學(xué)課程設(shè)計(jì)年

級(jí):

學(xué)

號(hào):

名:

專(zhuān)

業(yè):

指導(dǎo)老師:

二零一三年六月一.課程設(shè)計(jì)規(guī)定(簡(jiǎn)要描述課程設(shè)計(jì)旳規(guī)定)實(shí)現(xiàn)一種簡(jiǎn)樸旳小朋友商品倉(cāng)庫(kù)管理系統(tǒng)。系統(tǒng)旳重要功能是登記倉(cāng)庫(kù)中各個(gè)小朋友用品旳信息狀況,對(duì)部分信息進(jìn)行檢查和處理,并將成果保留。假設(shè)倉(cāng)庫(kù)中有3種不一樣類(lèi)型旳商品:食品、鞋子、玩具。對(duì)于食品,規(guī)定檢查與否過(guò)期,并作對(duì)應(yīng)處理;對(duì)于鞋子,規(guī)定檢查與否是過(guò)季產(chǎn)品,假如是,就要做對(duì)應(yīng)處理。二.模塊劃分(闡明函數(shù)和類(lèi)旳定義)查看信息模塊;添加貨品模塊;取出貨品模塊;修改信息模塊;三.源程序(程序代碼,附部分注釋?zhuān)?include"stdafx.h"#include"time.h"#include<iostream>usingnamespacestd;structtimes{ intyear,month,day;};classchildgoods{public: virtualvoidinputinformation()=0; virtualvoidadd()=0; voidtotalnumber();public: charname[20]; doublenumber; floatbid;//進(jìn)價(jià); intstock;//庫(kù)存; timesstorage_time;//入庫(kù)時(shí)間; intinputnumber; };classfood:publicchildgoods{public: food(){next=NULL;} voidinputinformation(); voidchangeinformation(food**f); voidadd(){}; voidshow(food*f); voidshowall(); friendvoidaddfood(food**f); friendvoidgetfood(food**f);public: timesshelf_life;//保質(zhì)期; food*next;};voidfood::show(food*f){ intnum; food*temp; cout<<"請(qǐng)輸入所要查看貨品旳編號(hào)."<<endl; cin>>num; temp=f; if(temp->number==num) temp->showall(); else { while(temp!=NULL) { if(temp->number==num) break; temp=temp->next; } temp->showall(); }}voidfood::showall(){ cout<<"名稱(chēng)編號(hào)進(jìn)價(jià)庫(kù)存入庫(kù)時(shí)間:年月日保質(zhì)期:年月日"<<endl; cout<<name<<"" <<number<<"" <<bid<<"" <<stock<<"" <<storage_time.year<<"" <<storage_time.month<<"" <<storage_time.day<<"" <<shelf_life.year<<"" <<shelf_life.month<<"" <<shelf_life.day<<endl; time_tnowtime;nowtime=time(NULL); doublesafetime; safetime=((storage_time.year+shelf_life.year-1970)*31536000+(storage_time.month+shelf_life.month)*2592023+(storage_time.day+shelf_life.day)*86400); if(safetime>nowtime) cout<<"本食品尚未過(guò)期."<<endl; else cout<<"本食品已過(guò)期,請(qǐng)盡快處理!"<<endl; }voidfood::inputinformation(){ cout<<"名稱(chēng):"<<endl; cin>>name; cout<<"編號(hào):"<<endl; cin>>number; cout<<"進(jìn)價(jià):"<<endl; cin>>bid; cout<<"入庫(kù)數(shù)量:"<<endl; cin>>inputnumber; cout<<"入庫(kù)時(shí)間:"<<endl<<"年:"; cin>>storage_time.year; cout<<"月:"; cin>>storage_time.month; cout<<"日:"; cin>>storage_time.day; cout<<"保質(zhì)期:"<<endl<<"年:"; cin>>shelf_life.year; cout<<"月:"; cin>>shelf_life.month; cout<<"日:"; cin>>shelf_life.day; stock=inputnumber;}voidfood::changeinformation(food**f){ intoption,changenum; food*temp=*f; cout<<"請(qǐng)輸入要修改貨品旳編號(hào):"<<endl; cin>>changenum; while(temp!=NULL) { if(temp->number==changenum) break; temp=temp->next; } if(temp==NULL) { cout<<"倉(cāng)庫(kù)內(nèi)無(wú)此貨品。"<<endl; } else { cout<<"1.名稱(chēng)2.編號(hào)3.進(jìn)價(jià)4.庫(kù)存"<<endl; cin>>option; while(option>4||option<1) { cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl; cout<<"1.名稱(chēng)2.編號(hào)3.進(jìn)價(jià)4.庫(kù)存"<<endl; cin>>option; } switch(option) { case1:cout<<"請(qǐng)輸入新名稱(chēng):"<<endl;cin>>temp->name;break; case2:cout<<"請(qǐng)輸入新編號(hào):"<<endl;cin>>temp->number;break; case3:cout<<"請(qǐng)輸入新進(jìn)價(jià):"<<endl;cin>>temp->bid;break; case4:cout<<"請(qǐng)輸入新庫(kù)存:"<<endl;cin>>temp->stock;break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;} } } }classshoe:publicchildgoods{public: voidinputinformation(); voidchangeinformation(shoe**s); voidadd(){}; voidshow(shoe*s); voidshowall(); voidshowone(){}; friendvoidaddshoe(shoe*s); friendvoidgetshoe(shoe**s);public: charseason[20]; shoe*now; shoe*next;};voidshoe::inputinformation(){ cout<<"名稱(chēng):"<<endl; cin>>name; cout<<"編號(hào):"<<endl; cin>>number; cout<<"進(jìn)價(jià):"<<endl; cin>>bid; cout<<"適合季節(jié):"<<endl; cin>>season; cout<<"入庫(kù)數(shù)量:"<<endl; cin>>inputnumber; cout<<"入庫(kù)時(shí)間:"<<endl<<"年:"; cin>>storage_time.year; cout<<"月:"; cin>>storage_time.month; cout<<"日:";}voidshoe::changeinformation(shoe**s){ intoption,changenum; shoe*temp=*s; cout<<"請(qǐng)輸入要修改貨品旳編號(hào):"<<endl; cin>>changenum; while(temp!=NULL) { if(temp->number==changenum) break; temp=temp->next; } if(temp==NULL) { cout<<"倉(cāng)庫(kù)內(nèi)無(wú)此貨品。"<<endl; } else { cout<<"1.名稱(chēng)2.編號(hào)3.進(jìn)價(jià)4.庫(kù)存"<<endl; cin>>option; while(option>4||option<1) { cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl; cout<<"1.名稱(chēng)2.編號(hào)3.進(jìn)價(jià)4.庫(kù)存"<<endl; cin>>option; } switch(option) { case1:cout<<"請(qǐng)輸入新名稱(chēng):"<<endl;cin>>temp->name;break; case2:cout<<"請(qǐng)輸入新編號(hào):"<<endl;cin>>temp->number;break; case3:cout<<"請(qǐng)輸入新進(jìn)價(jià):"<<endl;cin>>temp->bid;break; case4:cout<<"請(qǐng)輸入新庫(kù)存:"<<endl;cin>>temp->stock;break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;} } }}voidshoe::showall(){ cout<<"名稱(chēng)編號(hào)進(jìn)價(jià)適合季節(jié)庫(kù)存入庫(kù)時(shí)間:年月日"<<endl; cout<<name<<""<<number<<""<<bid<<""<<season<<""<<stock<<""<<storage_time.year<<""<<storage_time.month<<""<<storage_time.day<<endl; }voidshoe::show(shoe*s){ intnum; shoe*temp; cout<<"請(qǐng)輸入所要查看貨品旳編號(hào)."<<endl; cin>>num; temp=s; if(temp->number==num) temp->showall(); else { while(temp!=NULL) { if(temp->number==num) break; temp=temp->next; } temp->showall(); }}classtoy:publicchildgoods{public: voidinputinformation(); voidchangeinformation(toy**t); voidadd(){}; voidshow(toy*t); voidshowall(); voidshowone(){}; friendvoidaddtoy(toy*t); friendvoidgettoy(toy**t);public: intfitage[2]; toy*now; toy*next;};voidhomepage(food*f,shoe*s,toy*t);voidquit(food*f,shoe*s,toy*t);voidaddgoods(food*f,shoe*s,toy*t);voidtoy::show(toy*t){ intnum; toy*temp; cout<<"請(qǐng)輸入所要查看貨品旳編號(hào)."<<endl; cin>>num; temp=t; if(temp->number==num) temp->showall(); else { while(temp!=NULL) { if(temp->number==num) break; temp=temp->next; } temp->showall(); }}voidtoy::inputinformation(){ cout<<"名稱(chēng):"<<endl; cin>>name; cout<<"編號(hào):"<<endl; cin>>number; cout<<"進(jìn)價(jià):"<<endl; cin>>bid; cout<<"適合年齡"<<endl<<"最小年齡:"; cin>>fitage[0]; cout<<"最大年齡:"; cin>>fitage[1]; cout<<"入庫(kù)數(shù)量:"<<endl; cin>>inputnumber; cout<<"入庫(kù)時(shí)間:"<<endl<<"年:"; cin>>storage_time.year; cout<<"月:"; cin>>storage_time.month; cout<<"日:"; cin>>storage_time.day;}voidtoy::changeinformation(toy**t){ intoption,changenum; toy*temp=*t; cout<<"請(qǐng)輸入要修改貨品旳編號(hào):"<<endl; cin>>changenum; while(temp!=NULL) { if(temp->number==changenum) break; temp=temp->next; } if(temp==NULL) { cout<<"倉(cāng)庫(kù)內(nèi)無(wú)此貨品。"<<endl; } else { cout<<"1.名稱(chēng)2.編號(hào)3.進(jìn)價(jià)4.庫(kù)存"<<endl; cin>>option; while(option>4||option<1) { cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl; cout<<"1.名稱(chēng)2.編號(hào)3.進(jìn)價(jià)4.庫(kù)存"<<endl; cin>>option; } switch(option) { case1:cout<<"請(qǐng)輸入新名稱(chēng):"<<endl;cin>>temp->name;break; case2:cout<<"請(qǐng)輸入新編號(hào):"<<endl;cin>>temp->number;break; case3:cout<<"請(qǐng)輸入新進(jìn)價(jià):"<<endl;cin>>temp->bid;break; case4:cout<<"請(qǐng)輸入新庫(kù)存:"<<endl;cin>>temp->stock;break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;} } }}voidtoy::showall(){ cout<<"名稱(chēng)編號(hào)進(jìn)價(jià)適合年齡:從到庫(kù)存入庫(kù)時(shí)間:年月日"<<endl; cout<<name<<""<<number<<""<<bid<<""<<fitage[0]<<""<<fitage[1]<<""<<stock<<""<<storage_time.year<<""<<storage_time.month<<""<<storage_time.day<<endl; }voidaddfood(food**f){ food*temp=newfood; temp->inputinformation(); if(*f==NULL) { *f=temp; (*f)->next=NULL; } else { while((*f)->next!=NULL) { (*f)->next=(*f)->next->next; } (*f)->next=temp; (*f)->next->next=NULL; } }voidaddshoe(shoe**s){ shoe*temp=newshoe; temp->inputinformation(); if(*s==NULL) { *s=temp; (*s)->next=NULL; } else { while((*s)->next!=NULL) { (*s)->next=(*s)->next->next; } (*s)->next=temp; (*s)->next->next=NULL; }}voidaddtoy(toy**t){ toy*temp=newtoy; temp->inputinformation(); if(*t==NULL) { *t=temp; (*t)->next=NULL; } else { while((*t)->next!=NULL) { (*t)->next=(*t)->next->next; } (*t)->next=temp; (*t)->next->next=NULL; }}voidaddgoods_recycle(food*f,shoe*s,toy*t){ intoption; cout<<"************************"<<endl<< "**1.繼續(xù)添加**"<<endl<< "**2.返回首頁(yè)**"<<endl<< "**0.退出系統(tǒng)**"<<endl<< "************************"<<endl; cin>>option; switch(option) { case0:quit(f,s,t);break; case1:addgoods(f,s,t);break; case2:homepage(f,s,t);break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;addgoods_recycle(f,s,t);} }}voidaddgoods(food*f,shoe*s,toy*t){ intoption; cout<<"您要添加哪種貨品?"<<endl<<"1.食品2.鞋3.玩具"<<endl; cin>>option; switch(option) { case1:addfood(&f);break; case2:addshoe(&s);break; case3:addtoy(&t);break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;addgoods(f,s,t);} } cout<<"貨品添加成功。"<<endl; addgoods_recycle(f,s,t);}voidgetgoods_recycle(food*f,shoe*s,toy*t);voidgetfood(food**f,shoe*s,toy*t){ intnum,getnum; food*temp=*f; cout<<"請(qǐng)輸入物品編號(hào):"<<endl; cin>>num; cout<<"請(qǐng)輸入取出數(shù)量:"<<endl; cin>>getnum; if(*f==NULL) { cout<<"倉(cāng)庫(kù)內(nèi)無(wú)食品類(lèi)貨品!"<<endl; } else while(temp!=NULL) { if(temp->number==num) { while(temp->stock<getnum) { cout<<"數(shù)量局限性!請(qǐng)重新輸入:"<<endl; cin>>getnum; } temp->stock-=getnum; cout<<"取出成功!庫(kù)內(nèi)剩余數(shù)量為:"<<temp->stock<<endl; break; } elsetemp=temp->next; } if(temp==NULL) { cout<<"無(wú)此貨品!"<<endl; } getgoods_recycle(*f,s,t);}voidgetshoe(food*f,shoe**s,toy*t){ intnum,getnum; shoe*temp=*s; cout<<"請(qǐng)輸入物品編號(hào):"<<endl; cin>>num; cout<<"請(qǐng)輸入取出數(shù)量:"<<endl; cin>>getnum; if(*s==NULL) { cout<<"倉(cāng)庫(kù)內(nèi)無(wú)食品類(lèi)貨品!"<<endl; } else while(temp!=NULL) { if(temp->number==num) { while(temp->stock<getnum) { cout<<"數(shù)量局限性!請(qǐng)重新輸入:"<<endl; cin>>getnum; } temp->stock-=getnum; cout<<"取出成功!庫(kù)內(nèi)剩余數(shù)量為:"<<temp->stock<<endl; break; } elsetemp=temp->next; } if(temp==NULL) { cout<<"無(wú)此貨品!"<<endl; } getgoods_recycle(f,*s,t);}voidgettoy(food*f,shoe*s,toy**t){ intnum,getnum; toy*temp=*t; cout<<"請(qǐng)輸入物品編號(hào):"<<endl; cin>>num; cout<<"請(qǐng)輸入取出數(shù)量:"<<endl; cin>>getnum; if(*t==NULL) { cout<<"倉(cāng)庫(kù)內(nèi)無(wú)食品類(lèi)貨品!"<<endl; } else while(temp!=NULL) { if(temp->number==num) { while(temp->stock<getnum) { cout<<"數(shù)量局限性!請(qǐng)重新輸入:"<<endl; cin>>getnum; } temp->stock-=getnum; cout<<"取出成功!庫(kù)內(nèi)剩余數(shù)量為:"<<temp->stock<<endl; break; } elsetemp=temp->next; } if(temp==NULL) { cout<<"無(wú)此貨品!"<<endl; } getgoods_recycle(f,s,*t);}voidgetgoods(food*f,shoe*s,toy*t);voidgetgoods_recycle(food*f,shoe*s,toy*t){ intoption; cout<<"************************"<<endl<< "**1.繼續(xù)取出**"<<endl<< "**2.返回首頁(yè)**"<<endl<< "**0.退出系統(tǒng)**"<<endl<< "************************"<<endl; cin>>option; switch(option) { case0:quit(f,s,t);break; case1:getgoods(f,s,t);break; case2:homepage(f,s,t);break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;getgoods_recycle(f,s,t);} }}voidgetgoods(food*f,shoe*s,toy*t){ intoption; cout<<"取出1.食品2.鞋3.玩具"<<endl; cin>>option; switch(option) { case1:getfood(&f,s,t);break; case2:getshoe(f,&s,t);break; case3:gettoy(f,s,&t);break; default:cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;getgoods(f,s,t); }}voidcheckgoods(food*f,shoe*s,toy*t);voidcheckgoods_recycle(food*f,shoe*s,toy*t){ intoption; cout<<"************************"<<endl<< "**1.繼續(xù)查看**"<<endl<< "**2.返回首頁(yè)**"<<endl<< "**0.退出系統(tǒng)**"<<endl<< "************************"<<endl; cin>>option; switch(option) { case0:quit(f,s,t);break; case1:checkgoods(f,s,t);break; case2:homepage(f,s,t);break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;checkgoods_recycle(f,s,t);} }}voidcheckgoods(food*f,shoe*s,toy*t){ intoption; cout<<"您要查看哪種貨品?"<<endl<<"1.食品2.鞋3.玩具"<<endl; cin>>option; switch(option) { case1:f->show(f);break; case2:s->show(s);break; case3:t->show(t);break;default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;checkgoods(f,s,t);} } cout<<"查看完畢."<<endl; checkgoods_recycle(f,s,t);}voidchangeinfor(food*f,shoe*s,toy*t);voidchangeinfor_recycle(food*f,shoe*s,toy*t){ intoption; cout<<"************************"<<endl<< "**1.繼續(xù)修改**"<<endl<< "**2.返回首頁(yè)**"<<endl<< "**0.退出系統(tǒng)**"<<endl<< "************************"<<endl; cin>>option; switch(option) { case0:quit(f,s,t);break; case1:changeinfor(f,s,t);break; case2:homepage(f,s,t);break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;changeinfor_recycle(f,s,t);} }}voidchangeinfor(food*f,shoe*s,toy*t){ intoption; cout<<"1.食品2.鞋3.玩具"<<endl; cin>>option; switch(option) { case1:f->changeinformation(&f);break; case2:s->changeinformation(&s);break; case3:t->changeinformation(&t);break; default:{cout<<"輸入不合法,請(qǐng)重新輸入。"<<endl;changeinfor(f,s,t);} } changeinfor_recycle(f,s,t);}voidquit(food*f,shoe*s,toy*t){ charYorN; cout<<"確定要退出系統(tǒng)嗎?"<<endl<<"YorN?"<<endl; cin>>YorN; switch(YorN) { case'Y':return;break; case'y':return;break; case'N':homep

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論