mang.h

来自「利用虚函数定义工人信息」· C头文件 代码 · 共 23 行

H
23
字号
class manager:virtual public employee{
protected:
	float monthlypay,sale;
public:
	manager(){monthlypay=8000;}
	void input(){cout<<"经 理 ";employee::input();}
	void save(){
		fstream outfile;
		outfile.open("F:shuju.txt",ios::app);
		if(!outfile){
			cout<<"F can't open.\n";
			abort();
		}
		outfile<<"经 理"<<endl;
		outfile<<"号 码"<<no<<"名 字"<<name<<"性 别"<<sex<<"年 龄"<<age<<"工 资"<<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;
	}
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?