【C++ 第六章 个人银行账户管理程序案例】 您所在的位置:网站首页 账号管理程序 【C++ 第六章 个人银行账户管理程序案例】

【C++ 第六章 个人银行账户管理程序案例】

2024-07-11 04:29| 来源: 网络整理| 查看: 265

【第六章】 个人银行账户管理程序  案例实现

 

1 //第六章完整代码 2 #include 3 #include 4 #include 5 using namespace std; 6 class Date { 7 private: 8 int year; 9 int month; 10 int day; 11 int totalDays; 12 public: 13 Date(int year, int month, int day); 14 int getYear()const { return year; } 15 int getMonth() const { return month; } 16 int getDay()const { return day; } 17 int getMaxDay()const; 18 bool isLeapYear()const{ 19 return year % 4 == 0 && year % 100 != 0 || year % 400 == 0; 20 } 21 void show()const; 22 int distance(const Date &date)const { 23 return totalDays - date.totalDays; 24 } 25 }; 26 namespace 27 { 28 const int DAYS_BEFORE_MONTH[] = {0,31,59,90,120,151,181,212,243,273,304,334,365 }; 29 } 30 Date::Date(int year, int month, int day) :year(year), month(month), day(day) { 31 if (day getMaxDay()) { 32 cout


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有