Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

lCreate a lC++ class called upDate. It should have the following operations: upDate[ ) default constructor. This will set the date to May 11, 1959

image text in transcribed
lCreate a lC++ class called upDate. It should have the following operations: upDate[ ) default constructor. This will set the date to May 11, 1959 (A very important date\" !} upDate[int M, int D, int Y) overloaded constructor. This will set the date to the values passed in through the parameter list represented by Month, Day and Year. If any one ofthe parameters is out of range, the date is set to the default date. upDate[ int J] overloaded constructor create a date using the Julian date ~upDateI[ ] destructor. Be sure to deallocate any memory that was allocated in the constructor. void setDate{int M, int D, int Y} works just like the constructor int getMonthI[ } return the month in integer form int getDajrf } return the day of the month int getYearf ) return the year string getMonthName( ) return the name ofthe month Add the necessary class methods {functions} to support the following: upDate D1{1 [15212010],- H overloaded constructor upDate D2{D1); H copy constructor upDate D3 2 D2,- H also copy constructor initialize D3 to be copy of D2 D1 2 D2; H assignment operator D1 += 5,- \" add 5 days to D1, result is stored in D1 D1 -= '1"; H subtract 7 days from D1, result is stored in D1 D3 2 D2 + 5,- H add 5 days to D2, assign result to D3 D3 = 5 + D2,- ,Ff add 5 days to D2, assign result to D3 D3 2 D2 '1; H subtract 4 days from D2, assign result to D3 int x = D5 D4,- \" days between D5 and D4. Can be negative or positive cout

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

\f

Answered: 1 week ago