資源簡(jiǎn)介
使用C++寫(xiě)得書(shū)店管理系統(tǒng)。所用知識(shí):txt文件的基本操作,類(lèi),隨機(jī)數(shù),字符串的操作等

代碼片段和文件信息
#include
#include
#include
#include?
#include??
#include???
#include?“quick.h“
#include?“myself.h“
#include?“suiji.h“
#include?“menu.h“
#include?“clear.h“
#include?“profit.h“?
?
int?main()
{
????int?choice;
????Book?myBook;?
????profit?myprofit;
print_menu();???????????????????????//輸出菜單?
for(;;){
cin>>choice;
?if(choice==2)???????????
?????{
????? myself(0);???????????????????????//在buy.txt寫(xiě)入進(jìn)貨?
????? cout<<“數(shù)據(jù)已保存在buy.txt“< ?????}
?????if(choice==3)
?{
????myself(1);???????????????????????//在sale.txt寫(xiě)入賣(mài)出?
? cout<<“數(shù)據(jù)已保存在sale.txt“< ?}?
if(choice==1)????????????????//隨機(jī)測(cè)試?
{
???suiji(0);
???????myBook.setbook(00);?
???????cout<<“進(jìn)貨統(tǒng)計(jì)保存在expenditure.txt“< ????????suiji(1);
????myBook.setbook(10);????????????//每種書(shū)的賣(mài)出情況
?? cout<<“銷(xiāo)售統(tǒng)計(jì)保存在income.txt“< ? myprofit.newprofit();??????????//每種書(shū)利潤(rùn)情況?
? cout<<“利潤(rùn)統(tǒng)計(jì)保存在profit.txt“< }
if(choice==4)
{
cout<<“進(jìn)貨統(tǒng)計(jì):“< myBook.setbook(01);???????????????//每種書(shū)的進(jìn)貨情況?
????? cout<<“進(jìn)貨統(tǒng)計(jì)保存在expenditure.txt“< }
if(choice==5)
{
cout<<“銷(xiāo)售統(tǒng)計(jì):“< myBook.setbook(11);???????????????//每種書(shū)的銷(xiāo)售情況?
????? cout<<“銷(xiāo)售統(tǒng)計(jì)保存在income.txt“< }
?if(choice==6)
?{
? cout<<“利潤(rùn)統(tǒng)計(jì):?“< ?????myBook.setbook(00);???????????//每種書(shū)的進(jìn)貨情況?
? myBook.setbook(10);????????????//每種書(shū)的賣(mài)出情況
? myprofit.newprofit();??????????//每種書(shū)利潤(rùn)情況?
? cout<<“利潤(rùn)統(tǒng)計(jì)保存在profit.in.txt“< ?}?
???if(choice==7)clear(0);???//清空“buy.txt“文件
???????if(choice==8)clear(1);?//清空“sale.txt“文件?
???????if(choice==9){
??cout<<“返回菜單“< ??print_menu();}
???if(choice==10)break;? ????????????//結(jié)束?
???//cout<<“一共運(yùn)行時(shí)間“<<(double)clock()?/?CLOCKS_PER_SEC< }
return?0;
}
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-18?20:31??書(shū)店完善版\
?????文件?????????903??2018-05-18?20:31??書(shū)店完善版\Makefile.win
?????文件????????1726??2018-05-15?16:43??書(shū)店完善版\Project1.dev
?????文件?????1323468??2018-05-18?20:31??書(shū)店完善版\Project1.exe
?????文件?????????667??2018-05-18?20:44??書(shū)店完善版\Project1.layout
?????文件?????????110??2018-05-18?20:32??書(shū)店完善版\buy.txt
?????文件?????????316??2018-05-15?16:43??書(shū)店完善版\clear.h
?????文件?????????213??2018-05-18?20:33??書(shū)店完善版\expenditure.txt
?????文件?????????107??2018-05-18?20:33??書(shū)店完善版\income.txt
?????文件????????1993??2018-05-18?20:31??書(shū)店完善版\main.cpp
?????文件???????17568??2018-05-18?20:31??書(shū)店完善版\main.o
?????文件?????????504??2018-05-15?16:28??書(shū)店完善版\menu.h
?????文件?????????834??2018-05-18?20:31??書(shū)店完善版\myself.h
?????文件????????2698??2018-05-17?19:05??書(shū)店完善版\profit.h
?????文件?????????216??2018-05-18?20:33??書(shū)店完善版\profit.in.txt
?????文件????????2950??2018-05-15?16:28??書(shū)店完善版\quick.cpp
?????文件?????????821??2018-05-18?20:23??書(shū)店完善版\quick.h
?????文件????????6879??2018-05-15?16:30??書(shū)店完善版\quick.o
?????文件??????????45??2018-05-18?20:33??書(shū)店完善版\sale.txt
?????文件????????1182??2018-05-15?16:28??書(shū)店完善版\suiji.h
評(píng)論
共有 條評(píng)論