//File : month.h //Author : Andre Long //Due : October 20, 2004 //Description : This is the class specification file for the month class // Chapter 14 programming challenge 4 which using the // MyString class from chapter 14 #ifndef MONTH_H #define MONTH_H #include"myString.h" #include class month { private: MyString name; int monthNumber; public: int incommingMonthNumber; month() { name = "January"; monthNumber = 1; } month(MyString incommingName) { name = incommingName; if (incommingName=="january" || incommingName=="January" || incommingName=="JANUARY" || incommingName=="JAN") monthNumber=1; else if(incommingName=="febuary" || incommingName=="Febuary" || incommingName=="FEBUARY" || incommingName=="FEB") monthNumber=2; else if(incommingName=="march" || incommingName=="March" || incommingName=="MARCH" || incommingName=="MAR") monthNumber=3; else if(incommingName=="april" || incommingName=="April" || incommingName=="APRIL" || incommingName=="APR") monthNumber=4; else if(incommingName=="may" || incommingName=="May" || incommingName=="MAY") monthNumber=5; else if(incommingName=="june" || incommingName=="June" || incommingName=="JUNE" || incommingName=="JUN") monthNumber=6; else if(incommingName=="july" || incommingName=="July" || incommingName=="JULY" || incommingName=="JUL") monthNumber=7; else if(incommingName=="august" || incommingName=="August" || incommingName=="AUGUST" || incommingName=="AUG") monthNumber=8; else if(incommingName=="september" || incommingName=="September" || incommingName=="SEPTEMBER" || incommingName=="SEP") monthNumber=9; else if(incommingName=="october" || incommingName=="October" || incommingName=="OCTOBER" || incommingName=="OCT") monthNumber=10; else if(incommingName=="november" || incommingName=="November" || incommingName=="NOVEMBER" || incommingName=="NOV") monthNumber=11; else if(incommingName=="december" || incommingName=="December" || incommingName=="DECEMBER" || incommingName=="DEC") monthNumber=12; } month(int incommingMonthNumber) { monthNumber = incommingMonthNumber; switch(monthNumber) { case 1: name = "January"; break; case 2: name = "Febuary"; break; case 3: name = "March"; break; case 4: name = "April"; break; case 5: name = "May"; break; case 6: name = "June"; break; case 7: name = "July"; break; case 8: name = "August"; break; case 9: name = "September"; break; case 10:name = "October"; break; case 11:name = "November"; break; case 12:name = "December"; break; default:cout<<"The number of the month must be from 1 to 12"< 12) { cout<<"The numbers for the monthes range from 1 to 12"< 12) { cout<<"The numbers for the monthes range from 1 to 12"< 12) { cout<<"The numbers for the monthes range from 1 to 12"< 12) { cout<<"The numbers for the monthes range from 1 to 12"<>(istream &, month &); }; #endif