date.h

来自「C++编写的学生信息管理系统」· C头文件 代码 · 共 38 行

H
38
字号
//文件名:Date.h
//功能:实现记录职员生日和雇用日期的Date类
#ifndef Date_H
#define Date_H
#include<iostream>
using namespace std;
class Date
{
public:
    Date()
	{
		B_year=0;  B_month=0;  B_day=0;
		E_year=0;  E_month=0;  E_day=0;
	}
	void Date_display()
	{
		cout<<"出生日期为:"<<B_year<<"年"<<B_month<<"月"<<B_day<<"日"<<endl;
		cout<<"雇用日期为:"<<E_year<<"年"<<E_month<<"月"<<E_day<<"日"<<endl;
	}
	void set_Bdate()//设置出生年月
	{
		cout<<"请分别输入出生年月日:";
	    cin>>B_year>>B_month>>B_day;
	}
	void set_Edate()//设置雇用年月
	{
		cout<<"请分别输入雇用年月日:";
		cin>>E_year>>E_month>>E_day;
	}
protected:
	int B_year;   //出生日期
	int B_month;
	int B_day;
	int E_year;   //雇用日期
	int E_month;
	int E_day;
};
#endif

⌨️ 快捷键说明

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