Functional methods

The program fragment in Listing 4 shows three functional methods added to the Date class from the previous example.

Listing 4. Three functional methods.
class Date{
  int month, day, year;// private data members
  public:
  Date(int mo, int da, int yr);//public constructor
  Date operator+(int n);//overloaded operator function
  void Display();//display the date
  void AdjustMonth(int m);// +/- m months
  int DayOfWeek();//return 0-6 = Sun-Sat
};// note the required semicolon