Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the definition of the class dayType that implements the day of the week in a program. The class dayType should store the day as
Write the definition of the class dayType that implements the day of the week in a program. The class dayType should store the day as an integer: 0 for Sunday, 1 for Monday, etc.. The program should be able to perform the following operations on an object of type dayType.
- Set the day. The function's one parameter is an integer
- Print the string representation of the day. For example the function prints 0 as Sunday, 1 as Monday, and so on.
- Return the day as an integer
- Return the next day as an integer
- Return the previous day as an integer
- Calculate and return a new day by adding to or subtracting from the day. This operation does not change the day. The operation has one parameter, an integer, and returns an integer.
- Add a default constructor and a 1 parameter constructor
Write a program to test the various operations on the dayType class.
*NOTE: I need help to write out this problem in C++ while using Visual Studio 2017
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started