Home > Back-end >  Design and implementation of the date class
Design and implementation of the date class

Time:09-25

In the design of the string class,
1. Date set
2. The date display
3. The implementation at a certain date (month, day, year) on the function of add and subtract a number of days
4. Calculate the date interval days
5. As a class member function to achieve the above function, write the main function test the function

CodePudding user response:

CodePudding user response:

reference 1/f, the wise know already should good karma response:

Great god, and can write some, I am a novice, what all can't ah

CodePudding user response:


CodePudding user response:

 
From value=0, int value=0, log=0, annual value=0, 1 month value of 1=0, 1=0 log;
Cin & gt;> Annual value & gt;> Month value & gt;> Log & gt;> In value 1 & gt;> Value of 1 month & gt;> Log 1;
The date of the custom class (date) (month) (year) (annual value, value, date), (date) (month) (year) 1 (the value 1, the value of 1 month, log 1);
(date) (month) (year). The screen output date object data (year, month, day) the ();
(date) (month) (year) 1. The screen output date of the relevant data of the object (year, month, day) ();
(date) (month) (year). Add a day ();
(date) (month) (year). The screen output date object data (year, month, day) the ();
(date) (month) (year) 1. Add one day ();
(date) (month) (year) 1. The screen output date of the relevant data of the object (year, month, day) ();
The date of the custom class (date) (month) (year) (2018, 12, 16), 1 (2019, 12, 16) (date) (month) (year);/after/before - unlike Microsoft - first
Cout & lt;

CodePudding user response:

Moderator say yes

CodePudding user response:

The
reference 6 floor lights to reply:
moderator said yes

I learn don't understand this too fee,

CodePudding user response:

The
D reference 7 floor? e? s? i? r? e? Response:
Quote: refer to the aurora borealis ~ 6 floor response:
moderator said yes

I learn don't understand this too fee,
then you can fill in the code into the text

CodePudding user response:

reference 5 floor wise men know already should good karma response:
 
From value=0, int value=0, log=0, annual value=0, 1 month value of 1=0, 1=0 log;
Cin & gt;> Annual value & gt;> Month value & gt;> Log & gt;> In value 1 & gt;> Value of 1 month & gt;> Log 1;
The date of the custom class (date) (month) (year) (annual value, value, date), (date) (month) (year) 1 (the value 1, the value of 1 month, log 1);
(date) (month) (year). The screen output date object data (year, month, day) the ();
(date) (month) (year) 1. The screen output date of the relevant data of the object (year, month, day) ();
(date) (month) (year). Add a day ();
(date) (month) (year). The screen output date object data (year, month, day) the ();
(date) (month) (year) 1. Add one day ();
(date) (month) (year) 1. The screen output date of the relevant data of the object (year, month, day) ();
The date of the custom class (date) (month) (year) (2018, 12, 16), 1 (2019, 12, 16) (date) (month) (year);/after/before - unlike Microsoft - first
Cout & lt;

I don't know what to write code, but can I bother you to help me to write a write, I really don't these things, thank you for the

CodePudding user response:

you that's very strange!
You love to write a write a, love writing aa is writing aa, how can I help? Don't know how to write, you have to code only for your reference,

CodePudding user response:

 
Bool custom date classes: : determine whether a leap year ()
{
Return (return on the number of days (years, 2)==28? 0:1);
};

Cout & lt; <(date) (month) (year). Determine whether a leap year () & lt;

CodePudding user response:

the wise men know already 11 references, should take good karma response:
you that's very strange!
You love to write a write a, love writing aa is writing aa, how can I help? Don't know how to write, you have to code for your reference only,

Well, that trouble you, thank you

CodePudding user response:

 
Int back on the number of days (int N, int Y)
{//why https://bbs.csdn.net/topics/395074486
Return (Y==2? ((! (4) N % & amp; & (100) N %) | |! (N % 400)? 29:28) : (((Y & lt;=7 & amp; & Y % 2) | | (Y> 7 & amp; & ! (Y % 2)))? 31:30));
}

CodePudding user response:

  • Related