Define a class called DayOfWeek that is an abstract data type for a day in the week. Your class will have one member variable of type int to represent a day (1 for Monday, 2 for Tuesday, and so forth). Follow the ADT (Abstract Data Type) guideline to implement this class.
Include at least the following member functions:
1. a constructor to set the day using the first three letters (e.g. “MON” for Monday)
2. a constructor to set the day using an integer as an argument (e.g. 1 for Monday)
3. a default constructor
// input function
4. an input function that reads the day as the first three letters, accepts an input stream as parameter
// output function
5. an output function that outputs the day as an integer, accepts an output stream as parameter
6. a member function that returns the next day as a value of type DayOfWeek.
Test each member functions in the DayOfWeek class to make sure they are functioning properly before moving onto project B.
Write a program based on the DayOfWeek class in project A so that it:
- Accepts a 3-letter input from the user as the week of day (using member function #4 described above)
- Outputs the current day number, following by the next 6 days’ (using member function #5 & #6 described above)
1. Follow the ADT (Abstract Data Type) guideline to implement the required class
2. Comment well in your program and any functions you use
Please enter three letters for the day of week: (e.g. MON for Monday)
This is day 3 of the week.
This is day 4 of the week.
This is day 5 of the week.
This is day 6 of the week.
This is day 7 of the week.
This is day 1 of the week.
This is day 2 of the week.