Question
(C++) Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, such
(C++)
Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, such as Sun for Sunday. The program should be able to perform the following operation on objects of the type dayType:
a) A default constructor
b) A copy constructor
c) Set the day
d) Print the day
e) Return the day
f) Return the next day
g) Return the previous day
h) Update the day, stored in a dayType object , by adding certain days to it. For example, if the day is Monday and you add 4 days, the updated day is Friday. Similarly, if the day is Tuesday, and you add 13 days, the updated day is Monday.
i) Write the main program to test the dayType class, you have to test all the functions in the class design.
( Please show comments each step and output!!)
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