Answered step by step
Verified Expert Solution
Link Copied!

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, such as

image text in transcribed
Write the definition of the class dayType that implements the day of the week in a program.The class dayType should store the day, such as Sunday for Sunday. The program should be able to perform the following operatlons on an object 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 the current day. For example, If the current day is Monday and we add 4 days, the day to be returned is Friday. Similarly,W today is Tuesday and we add 13 days, the day to be returned is Monday s. Add the appropriate constructors. Write the definitions of the functions to implement the operations for the class dayType as defined above. Also, write a main program to test various operations on this class. Submit the following 3 files: (i) dayType.h (ii) dayTypelmp.cpp (iii) main.cpp Hint: Example member function of the class string dayType::nextDay() const int i static string weekDaysl71 ("Sunday", "Monday". "Tuesday", "Wednesday", "Thursday", "Friday", Saturday for (i-0;i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions