Class data#9072

Class data

1 second
64 megabytes
Easy

Create a class named Data that includes the fields day, month, and year.

Implement the following constructors:

- A default constructor that sets the date to 01.01.1900.

- A constructor that takes a string parameter of type char in the format dd.mm.yyyy to initialize the respective fields.

- A constructor that takes three integer parameters (day, month, year) to initialize the respective fields.

If the date is invalid during initialization, output "Error data..." followed by a new line. In such cases, set the date to 01.01.1900. The year should be within the range to .

Implement the following methods:

- void setDay(int) - updates the day value of the class.

- void setMonth(int) - updates the month value.

- void setYear(int) - updates the year value of the class.

- bool verifikation() - checks if the date is valid and returns true if correct, false otherwise. If the date is incorrect, set it to 01.01.1900.

- void OutDataddmmyy() - outputs the date in the format dd.mm.yy, e.g., 02.03.19.

- void OutDataddmmyyyy() - outputs the date in the format dd.mm.yyyy, e.g., 02.03.2019.

- void OutDataddMonthyyyy() - outputs the date in the format dd month yyyy, e.g., 02 March 2019.

The months should be displayed in English as follows:

January, February, March, April, May, June, July, August, September, October, November, December.

Note

Test : Verify the default constructor and the method OutDataddmmyy().

Tests -: Verify the constructor that accepts a char type string in the format dd.mm.yyyy and the methods verifikation(), OutDataddmmyy(), OutDataddmmyyyy(), OutDataddMonthyyyy().

Test : Verify the constructor that accepts three integer parameters (day, month, year) and the methods verifikation(), OutDataddmmyy(), OutDataddmmyyyy(), OutDataddMonthyyyy().

Test : Verify the default constructor and the methods setDay(..), setMonth(..), setYear(..), verifikation(), OutDataddmmyy(), OutDataddmmyyyy(), OutDataddMonthyyyy().