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 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.

  1. Set the day. The function's one parameter is an integer
  2. Print the string representation of the day. For example the function prints 0 as Sunday, 1 as Monday, and so on.
  3. Return the day as an integer
  4. Return the next day as an integer
  5. Return the previous day as an integer
  6. 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.
  7. 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

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions