Question: I need help fixing this code // file Chrono.h using namespace std; namespace Chrono { class Date { public: enum Month { jan=1, feb, mar,

I need help fixing this code

// file Chrono.h

using namespace std;

namespace Chrono {

class Date {

public:

enum Month {

jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec

};

class Invalid { }; // to throw as exception

Date(int y, Month m, int d); // check for valid date and initialize

Date(); // default constructor

// the default copy operations are fine

// nonmodifying operations:

int day() const { return d; }

Month month() const { return m; }

int year() const { return y; }

// modifying operations:

void add_day(int n);

void add_month(int n);

void add_year(int n);

private:

int y;

Month m;

int d;

};

bool is_date(int y, Date::Month m, int d); // true for valid date

bool leapyear(int y); // true if y is a leap year

bool operator==(const Date& a, const Date& b);

bool operator!=(const Date& a, const Date& b);

ostream& operator<<(ostream& os, const Date& d);

istream& operator>>(istream& is, Date& dd);

Date day_of_week(const Date& d); // day of week of d

Date next_Sunday(const Date& d); // next Sunday after d

Date next_weekday(const Date& d); // next weekday after d

const Date& defualt_date();

} // Chrono

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!