We're discussing constructors.
My problem is this:
Define a class called Month that is an ADT for a month with one variable as int to represent a month.
Include all of the following member functions: a constructor to set the month using the first three letters in the name of the month as three arguments, a constructor to set the month using an integer as an argument, a default constuctor, an input function that reads the month as an integer, an input funciton that reads the month as the first three letters in the name of the month, an output function that returns the next month as a value of type Month.
Here's what I've gotten so far:
class Month
{
public:
Month ( char , char , char ) ;
Month ( int ) ;
Month ( ) ;
void input ( char , char , char ) ;
void input ( int ) ;
void output ( char , char , char ) ;
Month nextMon ( ) ;
private:
int month ;
}
Could someone advise whether this is close or completely wrong (and why)?
Is this possible without having the three variables char1, char2, and char3 (or could I just implement those in main)?
ps) I'm lost as to how to do the output and the object returning functions