He is the question; Design and implement a class dayTypethat implements the day
ID: 3613757 • Letter: H
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 daysExplanation / 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; //coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.