Academic coaching, editing, and research guidance for university students.

Can I please get some assistance on this! I’m a newbie to this computer science thing and I’m struggling a lot.

1 min read
  

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.

Academic integrity note

Use this educational resource to build your understanding. Follow your institution’s rules and cite sources appropriately.

Want feedback on your own work?

Request Academic Support

Leave a Reply

Your email address will not be published. Required fields are marked *