Functions for attribute

by | Oct 20, 2021 | Homework Help

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.

Plagiarism-free and delivered on time!

We are passionate about delivering quality essays.

Our writers know how to write on any topic and subject area while meeting all of your specific requirements.

Unlike most other services, we will do a free revision if you need us to make corrections even after delivery.