#include iostream#include iomanip#include stringusing namespace std;class Date public 默认构造函数以fullyear的形式给出年月日默认值为1990年1月1日同时设置日期分隔符为- Dateint year = 1990 int month = 1 int day = 1 char separator = -;
类图如下:

类图中包含了Date类和Employee类,其中Employee类使用了Date类作为成员对象。Date类具有私有成员变量year、month、day和separator,以及公有成员函数和友元函数。Employee类具有私有成员变量firstName、lastName、birthDate和hireDate,以及公有成员函数print、getAge、getYearsWorked、getDaysWorked和getMostFaith。其中getMostFaith为静态函数,可以通过类名直接调用。
原文地址: https://www.cveoy.top/t/topic/fp97 著作权归作者所有。请勿转载和采集!