⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lab.cpp

📁 高校工资管理系统里面一些东西是通过模版写的因此在其他的类似的系统中也可以直接拿来用
💻 CPP
字号:
#include"lab.h"
#include"person.h"
#include<fstream.h>
#include<iostream.h>
#include<stdlib.h>
int lab::BasePayment=650;
int lab::BaseWorkTime=70;
int lab::addtion=150;
lab::lab(char *n,char *id,int wtime):person(n,id)
{
	Lworktime=wtime;
    Pay();	
}
void lab::Pay()
{
	Payment=(Lworktime-BaseWorkTime)*20+BasePayment;
}
lab::~lab()
{
}
 ostream& operator<<(ostream &sout,lab &s)
{
	 sout<<"姓名:"<<s.name<<"Id:"<<s.ID<<"工资:"<<s.Payment<<endl;//输出静态成员还存在问题
	return sout;
}
istream& operator>>(istream &sin,lab &s)
{
	cout<<"输入姓名与ID及工作时间:"<<endl;
	sin>>s.name>>s.ID>>s.Lworktime;
	return sin;
}
ofstream& operator<<(ofstream &fsout,lab &s)
{
	fsout<<s.name<<" "<<s.ID<<" "<<" "<<s.Lworktime<<" "<<s.Payment<<endl;
	return fsout;
}
ifstream& operator>>(ifstream &fsin,lab &s)
{   
	fsin>>s.name>>s.ID>>s.Lworktime>>s.Payment;
	return fsin;
}

⌨️ 快捷键说明

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