<<setw(15)<<this->danweiР <<endl;Р} Рfloat tong::Checkout(int quantity) //单个商品小结Р{ Р?int k=0;Р?float sum(0.0); Р? sum=s[k]->price * quantity; Р? return sum; Р} Рvoid tong::Total() //总结帐Р{ Р float sum = 0; Р float real; Р char GoOn; Р while(1)Р?{Р??cout<<"要结束商品买入请按'N/n',其继续买入请按'Y/y': "<<endl; Р cin>>GoOn; Р if(GoOn=='Y'||GoOn=='y'){Р int quantity; Р cout<<"请输入商品代码:"<<endl; Р cin>>code>>name; Р cout<<"请输入商品数量:"<<endl; Р cin>>quantity;Р???sum+=Checkout(quantity);Р cout<<"你购买的商品为:"<<endl; Р Display();Р??} Р??else if(GoOn=='N'||GoOn=='n')Р???break;Р?} Р?cout<<"----------------------------------------------------"<<endl;