Question
He is the question; Design and implement a class dayTypethat implements the day of the week in a program. The classdayType should store the day, such as sun for sunday. Theprogram should be able to perfom the following operations on anobject of type dayType. a) Set the day. b) Print the day c) Return the day, d) Return the next day, e) Return the previous day/ f) Calculate and return the day by adding certain days to thecurrent days He is the question; Design and implement a class dayTypethat implements the day of the week in a program. The classdayType should store the day, such as sun for sunday. Theprogram should be able to perfom the following operations on anobject of type dayType. a) Set the day. b) Print the day c) Return the day, d) Return the next day, e) Return the previous day/ f) Calculate and return the day by adding certain days to thecurrent days
Explanation / Answer
#include #include using namespace std; enum days{ sun, mon, tue, wed, thu, fri, sat }; class dayType { public: days day; public: dayType(days d)//Constructor { day=d; } void setDay(days d) { day =d; //cout