大神们这个究竟错在了哪里
#include<iostream>#include<string.h>
using namespace std;
class Enpoyee{
protected:
char num[8];
char name[8];
int basicSalary;
int prize;
public:
Enpoyee(char a[],char b[],int c,int d):basicSalary(c),prize(d){
strcpy(num,a);
strcpy(name,b);
}
void show(){
cout<<"编号"<<num <<"姓名"<< name <<"基本工资"<< basicSalary <<"奖金"<< prize<<endl;
}
void showsalary(){
cout<<"员工实发工资"<<basicSalary+prize<<endl;
}
};
class Saleman:virtual public Enpoyee{
protected:
float deductRate;
int personAmount;
public:
Salema(char a[],char b[],int c,int d,float e,int f):Enpoyee(a,b,c,d),deductRate(e),personAmount(f){//错在这里
}
void show2(){
Enpoyee::show();
cout<<"销售员提成比例"<<deductRate <<"个人销售额"<<personAmount<<endl;
}
void showsalary2(){
cout<<"销售员实发工资"<<basicSalary+prize+(deductRate*personAmount)<<endl;
}
};
int main(void){
Enpoyee a("007","小红",10000,1000);
a.show();
a.showsalary();
Saleman b("007","小红",10000,1000,0.5,2000);
b.show2();
b.showsalary2();
}