Question: Please write this code in Date.H or Date.hpp Header file, and main.cpp files please C++ Create a class that represents a Date. A Date object


Please write this code in Date.H or Date.hpp "Header file", and main.cpp files please C++
Create a class that represents a Date. A Date object has the following information: int month, as a number from 1 - 12 int day, as a number from 1 - 31 int year, as a number that is not negative . The Date class has the following functions: int getMonth() Description: returns the month from the object in number form int getDay() o Description: returns the day from the object int getYear() o Description: returns the year from the object void setMonth(int new_month) o Assigns the new_month value to the object's month o This function needs to make sure the new_month is a number from 1 - 12 void setMonth(string new_month) This function takes in the new_month as a 3 character string, such as JAN or MAR and stores the appropriate number in for the object's month void setDay(int new_day) This function assigns the new_day value to the object's day. o This function needs to make sure the day is a value from 1 - 31 void setYear(int new_year) o This function assigns the new_year value to the object's year. o This function needs to make sure the year is a value >= 1 void printDateNumericall) o This function prints the date in the following format: MM-DD-YYYY void printDate() o This function prints the date using the month name as in the following example: January 1, 2020 Main Driver File Instructions o Descipulon: returns the year rom the object void set Month(int new_month) o Assigns the new_month value to the object's month This function needs to make sure the new month is a number from 1 - 12 void set Month(string new_month) This function takes in the new_month as a 3 character string, such as JAN or MAR and stores the appropriate number in for the object's month void setDay(int new_day) o This function assigns the new day value to the object's day. This function needs to make sure the day is a value from 1 - 31 void setYear(int new_year) This function assigns the new_year value to the object's year. o This function needs to make sure the year is a value >= 1 void printDateNumericall) This function prints the date in the following format: MM-DD-YYYY void printDate() This function prints the date using the month name as in the following example: January 1, 2020 Main Driver File Instructions 1: Create a Date object and set the date to your birthday for this year. Then print this date using the printDateNumerical() function and the printDate() function. 2: Then ask the user for a new date and store it in the object created in step 1 (Hint: Use the functions that begin with set). Part 3: Display the new user date using the printDateNumerical() function and the printDate() function. Submit a zipped file with your Date.h or Date.hpp, Date.cpp and main.cpp files
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
