91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 983KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-08
  • 語言: C/C++
  • 標(biāo)簽: C++??

資源簡(jiǎn)介

編寫商品銷售統(tǒng)計(jì)程序,商品的信息有商品的名稱。計(jì)算單位(重量或件)、單價(jià)。所有商品的信息事先存入計(jì)算機(jī),屏幕上顯示所有的名稱,選擇商品名,輸入商品計(jì)量單位(如重量、件數(shù)等),根據(jù)單價(jià)算出總價(jià)。客戶一次購(gòu)物可能購(gòu)買多種商品,程序應(yīng)計(jì)算出客戶應(yīng)付的錢款數(shù)。

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include
using?namespace?std;
class?commodityManagement{?
public:
string?name;
double?price;?
int?number;?
commodityManagement?*next_ptr;?
void?SaveInformation(commodityManagement?*p);
void?LoadInformation();
void?AddGoods();
void?ModifyGoods();
void?DeleteGoods();
void?ShowGoods(commodityManagement?*hh);
};?
class?printMenu{
public:
void?mainMenuInformation();
????void?goodsMenuInformation();
void?buyMenuIformation();

};
class?buy
{
public:
void?BuyGoods();

};
commodityManagement?*Head;
commodityManagement?*Head_file;?

void?commodityManagement::SaveInformation(commodityManagement?*p)?
{?
ofstream?fout(“goods.txt“);?
if(!fout)?
{?
cout<<“cannot?open?the?file!“< exit(0);?
}?
while(p!=NULL)?
{?
fout<number?<<‘?‘<name<<‘?‘<price< p=p->next_ptr;?
}?
fout.close();?
}?
void?commodityManagement::LoadInformation()?
{?
commodityManagement?*q*pEnd;?
q=new?commodityManagement;?
pEnd=q;?
Head_file=NULL;?
ifstream?fin(“goods.txt“);?
if(!fin)?
{?
cout<<“cannot?open?the?file!“< exit(0);
}?
fin>>q->number>>q->name>>q->price;?
while(!fin.eof())?
{?
if(Head_file==NULL)?
{?
Head_file=q;?
}?
else?
{?
pEnd->next_ptr=q;?
}?
pEnd=q;?
q=new?commodityManagement;?
fin>>q->number>>q->name>>q->price;?
}?
if(fin.eof())?
{?
pEnd->next_ptr=NULL;?
q=NULL;
}?
fin.close();?
}?

void?commodityManagement::AddGoods()?
{?
commodityManagement?*temp=Head_file;?
int?k;?
string?name1;?
while(temp->next_ptr!=NULL)?
{?
temp=temp->next_ptr;?
}
commodityManagement?*q;?
temp->next_ptr=q=new?commodityManagement;?
q->number=temp->number+1;?
cout<<‘\n‘<<“請(qǐng)輸入新的商品名(輸入0退出添加):“;?
cin>>name1;?
if(name1==“0“)
{
system(“cls“);
return;?
}
q->name=name1;?cout<<‘\n‘<<“請(qǐng)輸入價(jià)格:“;?
cin>>k;?
q->price=k;?
q->next_ptr=NULL;?
SaveInformation(Head_file);?
cout< getch();
system(“cls“);
}?
void?commodityManagement::ModifyGoods()?
{?

commodityManagement?*temp=Head_file;?
int?jk;?
string?name1;?
cout<<‘\n‘<<“請(qǐng)輸入需要修改的商品代碼(輸入0退出修改):“;?
cin>>j;
if(j==0)?
{
system(“cls“);
????return;
}
while(temp->number!=j&&temp->next_ptr!=NULL)?
{?
temp=temp->next_ptr;?
}?
cout<<‘\n‘<<“請(qǐng)輸入新的商品名:“;?
cin>>name1;?
temp->name=name1;?
cout<<‘\n‘<<“請(qǐng)輸入價(jià)格:“;?
cin>>k;?
temp->price=k;?
SaveInformation(Head_file);?
cout<<‘\n‘<<“商品修改成功(按任意鍵返回)“< getch();
system(“cls“);
}?
void?commodityManagement::DeleteGoods()?
{?
commodityManagement?*temp=Head_file;?
int?j;?
cout<<‘\n‘<<“請(qǐng)輸入需要?jiǎng)h除的商品代碼(輸入0退出修改):“;?
cin>>j;?
if(j==0)?
{
system(“cls“);
return;
}?
while(temp->number!=(j-1)&&temp->next_ptr!=NULL)?
{?
temp=temp->next_ptr;?
}?
commodityManagement?*pp=temp->next_ptr;?
temp->next_ptr=temp->next_ptr->next_ptr;?
delet

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????99328??2011-04-12?18:49??C++商品管理課程設(shè)計(jì)\Debug\vc60.idb

?????文件?????135168??2010-12-11?19:26??C++商品管理課程設(shè)計(jì)\Debug\vc60.pdb

?????文件?????602189??2010-12-19?09:19??C++商品管理課程設(shè)計(jì)\Debug\商品管理.exe

?????文件?????857612??2010-12-19?09:19??C++商品管理課程設(shè)計(jì)\Debug\商品管理.ilk

?????文件?????399825??2010-12-19?09:19??C++商品管理課程設(shè)計(jì)\Debug\商品管理.obj

?????文件????2169460??2010-12-09?21:34??C++商品管理課程設(shè)計(jì)\Debug\商品管理.pch

?????文件????1197056??2010-12-11?19:26??C++商品管理課程設(shè)計(jì)\Debug\商品管理.pdb

?????文件????????206??2010-12-14?10:31??C++商品管理課程設(shè)計(jì)\goods.txt

?????文件???????7214??2010-12-10?17:21??C++商品管理課程設(shè)計(jì)\商品管理.cpp

?????文件???????3427??2011-04-12?18:48??C++商品管理課程設(shè)計(jì)\商品管理.dsp

?????文件????????541??2011-04-12?18:49??C++商品管理課程設(shè)計(jì)\商品管理.dsw

?????文件??????50176??2011-04-12?18:49??C++商品管理課程設(shè)計(jì)\商品管理.ncb

?????文件??????48640??2011-04-12?18:49??C++商品管理課程設(shè)計(jì)\商品管理.opt

?????文件????????752??2011-04-12?18:49??C++商品管理課程設(shè)計(jì)\商品管理.plg

?????目錄??????????0??2011-04-12?18:44??C++商品管理課程設(shè)計(jì)\Debug

?????目錄??????????0??2011-04-12?18:49??C++商品管理課程設(shè)計(jì)

-----------?---------??----------?-----??----

??????????????5571594????????????????????16


評(píng)論

共有 條評(píng)論