执行 cl.exe 时出错!C++高手帮我看看那里出错呀,帮忙改过来!谢谢
#include<iostream.h>
#include<stdlib.h>
#include<fstream.h>
#include<iomanip.h>
#include<string.h>
class employee
{
public:
employee()
{
salary=0;
}
void pay(){}
void print(){}
void input()
{
cout<<"ID:";
cin>>no;
cout<<" NAME:";
cin>>name;
cout<<" SEX(m/w):";
cin>>sex;
cout<<" AGE:";
cin>>age;
}
protected:
int no;
char name[8];
float salary;
char sex;
int age;
};
class manager:virtual public employee
{
protected:
float monthlypay,sale;
public:
manager(){monthlypay=8000;}
void input(){cout<<"Manger";employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"Manger"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void pay(){salary=monthlypay;}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)<<sex\
<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
class technician:virtual public employee
{
private:
float hourlyrate;
int workhours;
public:
technician(){hourlyrate=100;}
void pay()
{
cout<<name<<"Work hour:";
cin>>workhours;
salary=hourlyrate*workhours;
}
void input(){cout<<"TECHNICIAN"<<endl;employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"TECHNICIAN"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)<<sex\
<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};
class salesman:virtual public employee
{
protected:
float commrate;
float sales;
public:
salesman(){commrate=0.04;}
void input(){cout<<"SALEMAN";employee::input();}
void save()
{
fstream outfile;
outfile.open("f:flsdfj.txt",ios::app);
if(!outfile)
{
cout<<"f can't open.\n";
abort();
}
outfile<<"TECHNICIAN"<<endl;
outfile<<"ID"<<no<<"NAME"<<name<<"SEX"<<sex<<"AGE"<<age<<"SALARY"<<salary<<endl;
}
void pay()
{
cout<<name<<"Sales volume:";
cin>>sales;
salary=sales*commrate;
}
void print()
{
cout<<"├─────┼─────┼─────┼─────┼─────┤"<<endl;
cout<<"│"<<setw(10)<<no<<"│"<<setw(10)<<name<<"│"<<setw(10)\
<<sex<<"│"<<setw(10)<<age<<"│"<<setw(10)<<salary<<"│"<<endl;
}
};