Develop in C a class date to represent a calendar The class

Develop in C++ a class date to represent a calendar. The class should provide the following operations:

A default constructor that initializes a date object to 01-01-1900.

A class constructor that initializes a date object to a correct value using three integer

parameters corresponding to the desired month, day and year.

The function toString() that returns the string version of a date object. For example,

applying toString() to the date 12-01-2000 produces \"December 1st, 2000\".

The function nextDate() that returns the successive date i.e. the new value of the date object. For example, applying nextDate() to the date 12-31-2000 produces a new date: 01-01-2001. You should take into account if the year is a leap year or not. A leap year is: (1) divisible by 400 or (2) divisible by 4 and not divisible by 100.

The function compareDates() that checks if the date of interest is before, after or equal to the argument date.

A simple run of the driver program follows.

Another run:

***Need a header file and implementation file***

Solution

#include<iostream>

#include<sstream>

using namespace std;

char months[12][10]={\"January\", \"February\", \"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"};

class Date{ int dd,mm,yy;

public : Date(){ dd

Develop in C++ a class date to represent a calendar. The class should provide the following operations: A default constructor that initializes a date object to

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site