Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the C++ code for this assignment The Date class has the following public member functions: Date (); //Constructor should initialize date to 12000

I need the C++ code for this assignment
image text in transcribed
image text in transcribed
image text in transcribed
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, get Mon thName (). 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 dispal YSTD() 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"; II.. Finish the rest by yourself Note: copy/paste your output at the end of program within a pair of comment symbols (/ and * / ) There is a one part laboratory for designing classes. You will be required to submit to Blackboard one C++ file: LabDesignclass FirstNameLastName. cpp. The code in the file must include your name, the course and the file name in comments. /l 11 Nam: Lucinda A. Jackson // Class/Section: csC 260L-01 /1 Eile Name: LabDesignClassEirstNameLastName. opp f/ Program description: write detailed description here 11 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. Minclude ciostreans using nuecpace std; Int main( ) I Date Myoate, Tedny? Int Not, par, Yeaf, cout 2e - Input Month, Day, Yeer i: cin poli $3 bay YeAl; Myoute, seroete(mos, pay. if4e): Myoate.displaymari: cont ke andi. Today,iefolate 10,1, 2ee ) i Tedwedisplayinic. Tesay.dinplosto(?) cont te endi; foday. Sefoete oken, RaW, Yeany? retwin of include cinMOMDAY YEAR; MyDate, setDate(MON, DAY, YEAR); MyDate.displaynuM(); cout endl; Today-setDate (10,1,1946); Today-displayinT(); Today.displaysto(); cout \& end1; Today-getDate (WOr, DAY, YEAR); cout MOW - DAY YEAR end1; neturn o; 13 WIIIIIIIIIIIIIIIIIIIIIIIII/I/III/I/I/I Class functions implementation

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

4 Column Ledger Book Large Simple Four Column For Bookkeeping Accounting And Personal Use

Authors: Prunella G. Adam Books Publishing

1st Edition

B0C9SDLSLK

Students also viewed these Databases questions