Please help Language should be simple c Use Enumeration Do n

Please help. Language should be simple c++. Use Enumeration. Do not change main. Please make the program simple. Thank you

Implement class Day which represents a day of the week. Overload operator+=, operator-=, operator++ (prefix), and operator-- (prefix), and operator<< as described below.

Solution

#include \"dayType.h\"

void dayType::setDay(string newDay)

{

   currentDay = newDay;

}

void dayType::printDay()

{

   cout << \"Day chosen is \" << currentDay << endl;

}

int dayType::showDay(int& day)

{

   return day;

}

int dayType::nextDay(int day)

{

                day = day++;

                if (day > 6)

                                day = day % 7;

                switch (day)

                {

                case 0: cout << \"The next day is Sunday\";

                                break;

                case 1: cout << \"The next day is Monday\";

                                break;

                case 2: cout << \"The next day is Tuesday\";

                                break;

                case 3: cout << \"The next day is Wednesday\";

                                break;

                case 4: cout << \"The next day is Thursday\";

                                break;

                case 5: cout << \"The next day is Friday\";

                                break;

                case 6: cout << \"The next day is Saturday\";

                                break;

                }

                cout << endl;

                return day;

}

               

int dayType::prevDay(int day)

{

                day = day--;

                switch (day)

                {

                case -1: cout << \"The previous day is Saturday.\";

                                break;

                case 0: cout << \"The previous day is Saturday.\";

                                break;

                case 1: cout << \"The previous day is Saturday.\";

                                break;

                case 2: cout << \"The previous day is Saturday.\";

                                break;

                case 3: cout << \"The previous day is Saturday.\";

                                break;

                case 4: cout << \"The previous day is Saturday.\";

                                break;

                case 5: cout << \"The previous day is Saturday.\";

                                break;

                default: cout << \"The previous day is Saturday.\";

                }

                cout << endl;

                return day;

}

int dayType::calcDay(int addDays, int numDays)

{

                addDays = addDays + numDays;

                if (addDays > 6)

                                addDays = addDays % 7;

                switch(addDays)

                {

                case 0: cout << \"The calculated day is Sunday.\";

                                break;

                case 1: cout << \"The calculated day is Monday.\";

                                break;

                case 2: cout << \"The calculated day is Tuesday.\";

                                break;

                case 3: cout << \"The calculated day is Wednesday.\";

                                break;

                case 4: cout << \"The calculated day is Thursday.\";

                                break;

                case 5: cout << \"The calculated day is Friday.\";

                                break;

                case 6: cout << \"The calculated day is Saturday.\";

                                break;

                default: cout << \"Not valid choice.\";

                }

                cout << endl;

                return addDays;

}

Please help. Language should be simple c++. Use Enumeration. Do not change main. Please make the program simple. Thank you Implement class Day which represents
Please help. Language should be simple c++. Use Enumeration. Do not change main. Please make the program simple. Thank you Implement class Day which represents
Please help. Language should be simple c++. Use Enumeration. Do not change main. Please make the program simple. Thank you Implement class Day which represents

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site