Design a class called My_Date. The class has three integer attributes: month, day, year, and a stringattribute month_name. Define mutator (set) and accessor (get) functions for each attribute. Define adefault constructor which initializes date to 1/1/1900. There are two more public member functions,printDate1() and printDate2() which print dates in the following formats:printDate1(): 12/25/2020printDate2(): December 25, 2020My_Date()void setMonth(int)void setDay(int)void setYear(int)void setMonth_Name() //no parameter for set nameint getMonth()int getDay()int getYear()string getMonth_Name()void printDate1()void printDate2()Input Validation:Do not accept values for the day greater than 31 or less than 1 for month 1 (Jan), 3 (Mar), 5(May), 7 (Jul), 8(Aug), 10 (Oct), and 12 (Dec).Do not accept values for the day greater than 30 or less than 1 for month 4 (Apr), 6 (Jun), 9 (Sep),and 1 1 (Nov).For month 2 (Feb), check if a year is a leap year. If an input year is a leap year then Feb. 29should be a valid date, otherwise it’s invalid.Bonus feature (5 points):If user input an invalid day or month, ask user to input again until the input value is valid.
Can I please get some assistance on this! I’m a newbie to this computer science thing and I’m struggling a lot.
How it works
- Paste your instructions in the instructions box. You can also attach an instructions file
- Select the writer category, deadline, education level and review the instructions
- Make a payment for the order to be assignment to a writer
- Download the paper after the writer uploads it
Will the writer plagiarize my essay?
You will get a plagiarism-free paper and you can get an originality report upon request.
Is this service safe?
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Recent Comments