Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program Define a class called Month. Your class will have one member variable of type int to represent a month (1 for January, 2

C++ program image text in transcribed
Define a class called Month. Your class will have one member variable of type int to represent a month (1 for January, 2 for February, and so forth). Include all the following member functions: --constructor to set the month using the first three letters in the name of the month as three arguments, such as jan for month 1. --a constructor to set the month using an integer as an argument (1 for January, 2 for February, and so forth) -- default constructor --an input member function that reads the month as an integer --an input member function that reads the month as the first three letters in the name of the month --an output member function that outputs the month as an integer -an output member function that outputs the month as the first three letters in the name of the month --member function that returns the next month as a value of type Month. Prompt the user to enter a month in int (make this a dynamic variable), and output the first three letters of the month and the number of the month. You may also experiment initializing your objects with the various constructors

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions