Plz help C++ REVEL
Design a class named Month. The class should have the following
members:
Data Members:
An int variable named num to hold the month number, which is an
integer in the range of 1 through 12.
A static array of twelve strings named monthName, initialized with
the names of the months. For example, monthName[0] should be set to
"January", monthName[1] should be set to "February", etc. The
static array will be used as a lookup table to look up the name of
a month.
Constructors:
The class should have a default constructor that sets the num
member variable to 0 as well as a constructor that accepts an int
argument for the num member variable.
Mutators:
A setNum function that accepts an int argument for the month
number. The setNum function should assign this value to the num
member variable.
A setName function that accepts a string argument for the name of
the month. The setName function should find the name in the
monthName array, and then update the num member variable with the
correct number. For example, if the argument is "January", the num
variable will be set to 1. If the argument is "April", the num
variable will be set to 4. And so on. If the argument is not found
in the monthName array, the num member variable will be set to
0.
Accessors:
A getNum function that returns the value of the num member
variable.
A getName function that returns the name of the month, based on the
value of the num member variable. For example, if num is equal to
1, the getName function will return "January", and if num is equal
to 12, the getName function will return "December". If num is less
than 1 or greater than 12, the getName function should return the
string "Unknown".
Overloaded ++ and -- Operators:
The class should overload both the prefix and postfix versions of
++ and -- operators, such that they increment or decrement the
month number respectively.
Note: If the month number is 12 (or greater) when the increment
operator is called, the month number will become 1. If the month
number is 1 (or less) and the decrement operator is called, the
month number becomes 12.
Overloaded << and >> Operators:
The class should overload the << and >> operators such
that the << operator displays a month name and the >>
operator allows the user to input a month number.
main Function:
Write a main function that demonstrates the Month class. The
program should allow the user to enter a month number. It should
display the name of that month followed by the next 7 months. Then,
the program should allow the user to enter another month number. It
should display the name of that month followed by the previous 7
months.
Note: You may assume the user will always input an integer between
1 and 12.
The following sample runs show the expected output of the program.
The user's input is shown in bold. Notice the wording of the
prompts and the placement of spaces and punctuation. Your program's
output must match this.
Sample Run #1:
Enter: month number (1-12):1
The next 8 months are: January, February, March, April, May, June,
July, August.↵
Enter: another month number (1-12):12
The previous 8 months were: December, November, October, September,
August, July, June, May.↵
Sample Run #2:
Enter: month number (1-12):8
The next 8 months are: August, September, October, November,
December, January, February, March.↵
Enter: another month number (1-12):3
The previous 8 months were: March, February, January, December,
November, October, September, August.↵