g
if(Duty==3) {
cout<<"本月销售额:"; cin>>Amount; }
else if(Duty==4) {
cout<<"本月工作小时数(0-168):"; cin>>T; }
6.2 查询本月经营模块
显示函数如下: void Company::Query() {
cout<<"\n** 查询人员本月销售信息 **\n";
double sum=0; //销售额总和 Person *p=Worker; while(p) {
if(p->Duty==3)sum+=((Sales *)p)->GetAmount(); p=p->next; }
p=Worker;
double sum2=0; //工资总和 while(p) {
if(p->Duty==2)((SalesManager *)p)->SetAmount(sum); p->Output(); sum2+=p->Earning;