Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please read the FULL instructions. Do not copy answers from other people and paste it here, it's most likely false. Thank you. Correct answer will

Please read the FULL instructions. Do not copy answers from other people and paste it here, it's most likely false. Thank you. Correct answer will be given multiple thumbs up.

image text in transcribed

This is what it should ask and print. 12 was entered, so it printed This month is Dec and so on.

The second part asked for first letter, second letter, and third letter. Then it gave the number, and the NAME of the next month.

image text in transcribed

Here's the input.

image text in transcribed

Here's the output.

image text in transcribed

Define a class called Month that is an abstract data type for a month. Your class should have a private intager variable that represents the month (1 for January, 2 for February, etc.). Include all the following member functions - A default constructor that set's the month to January - A constructor to set the month using the first three letters in the name of the month as three arguments - A constructor to set the month using an integer as an argument. - A mutator function that sets the month by passing in an integer - An accessor function that returns the value of the month as an integer - An accessor function that returns the first three letters in the name of the month - A Member function that returns the next month as a value of type Month Make sure your class validates user input to verify that a valid month was entered In main(), test your program by creating 3 different Month objects. The first month object should use an integer value entered by the user as the argment to the constructor. Then, use the Month class member functions to print out the first three letters of the corresponding month and the first three letters of the next month The second month object should take 3 letters that the user enters as arguments to the constructor Then, use the Month class member functions to print out the value of that month as an integer, as well as the first three letters of the next month onstructor. Print out the first three letters The third month object should be created using the def of that month and the next month

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

=+(17.24) ['If(x) dx Answered: 1 week ago

Answered: 1 week ago