Question: C++ using template pictured Define a class called Month that is an abstract data type for a month. Your class will have one member variable

C++ using template pictured C++ using template pictured Define a class called Month that is anabstract data type for a month. Your class will have one membervariable of type int to represent a month (1 for January, 2

Define a class called Month that is an abstract data type for a month. Your class will have one member variable of type int to represent a month (1 for January, 2 for February, and so forth). Include all 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 (1 for January, 2 for February, and so forth), a default constructor, an input function that reads the month as an integer, an input function that reads the month as the first three letters in the name of the month, an output function that outputs the month as an integer, an output function that outputs the month as the first three letters in the name of the month, and a member function that returns the next month as a value of type Month. The input and output functions will each have one formal parameter for the stream. Embed your class definition in a test program.

class Month public: Month (char ci, char c2, char ca); //constructor to set month based on first 1/3 chars of the month name Month int monthlumber): //a constructor to se month base on month number, 1/1 - January etc. Month(); //a default constructor (what does it do? nothing) void getlonchylumber (stream) //an input function to set the month based on the //month number void getMonthByName (istream) // input function to set the month based on a three //character input void outputMonthNumber(ostream) //an output function that outputs the month as an integer, void output Monthlane (ostream) // an output function that outputs the month as the letters. Month next Month(); // 1/a function that returns the next month as a month object int monthlumber() private: int with // Complete the member functions here void error (char ci, char c2, char c3) { cout

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!