Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Please help me with this C++ project. It is on operator over loading and pointers. I am providing some additional instrusctions to help. Thank you

Please help me with this C++ project. It is on operator over loading and pointers. I am providing some additional instrusctions to help. Thank you so much! image text in transcribed
image text in transcribed
image text in transcribed
Create a C++ 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!!) up Date(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 of the 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 upDate() - destructor. Be sure to de-allocate any memory that was allocated in the constructor void setDate(int M, int D, int Y)- works just like the constructor . int getMonth() - return the month in integer form int getDay() - return the day of the month int getYear() - return the year string getMonthName() - return the name of the month Add the necessary class methods (functions) to support the following: upDate D1(10,27,2010): // overloaded constructor upDate D2(D1) // copy constructor / I assignment operator // add 5 days to D1, result is stored in D1 // subtract 7 days from DI, result is stored in D1 D1-7 upDate D3-D2+5; // add 5 days to D2, assign result to D3 upDate D4-5+ D2; // add 5 days to D2, assign result to D4 .upDate D5 D2-4; // subtract 4 days from D2, assign result to D5 // days between D5 and D4. Can be negative or positive int x D5-D4 . cout D2) Additional requirements You MUST create a pointer in the private data members that points to an integer array. When you create an upDate object (using the constructor) you must dynamically allocate an array of three integers - the Month, Day and Year. Write a driver program that tests each operation. I will provide a test program to you before the due date

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions