Question: c + + Design a class named Month. The class should have the following private member variables: name, a string that holds the name of

c++
Design a class named Month. The class should have the following private member variables: name, a string that holds the name of the month,
and monthNumber, an integer from 1 to 12).
The class member functions:
a. A default constructor that sets the name to January and the month number to 1.
b. A constructor that sets the name of the month as an argument and automatically sets the month number to the appropriate value.
c. A constructor that sets the month number as an argument and automatically sets the month name to the appropriate value.
d. Get and set functions for the member variables.
e. toString() that displays like this: 1- January, 2- February, etc.
Write a program that tests all of the member functions and overloaded operators in the class implementation.

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 Programming Questions!