Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help on this c++ problem, if you help thank you so much! Design a class called Date. The class should store a date in

Need help on this c++ problem, if you help thank you so much!image text in transcribedimage text in transcribed

Design a class called Date. The class should store a date in three integers in its private part: month, day and year. There should be member functions to print the date in the following forms: Implement the class and test the class using the main() shown below. The Date class has the following public member functions: Date (); //Constructor should initialize date to 12000 void setDate(int, int, int); void getDate(int \&, int \&, int \&) const; void displayNUM() const; void displaySTD() const; void displayINT() const; Inside of the SetDate () function, below, do NOT accept values for the day greater than 31 or less than1, and do NOT accept values for the month greater than 12 or less than 1. For bad input, set the day and the month to 0 . The Date class also has a private member function, getMonthName (). This function is a value_return function with no parameter passed in. It returns the name of the month as a string. This function should be call in both dispalySTD () and displayINT() functions to show the name of the month. string getMonthName () const; In the getMonthName (), You can use a switch statement on the month to get the name of each month and return the name: switch(month) \{ case 1: return "January"; case 2: return "February"; //.... Finish the rest by yourself \} Note: copy/paste your output at the end of program within a pair of comment symbols (/ and /)

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions