Summary

Create a class named USCalendar class that offers a variety of functionality based off the DateTime class: http://msdn.microsoft.com/en-us/library/system.datetime.aspx

Note: Don’t inherit from DateTime class, create your own custom class that utilizes DateTime within it.

Implement 4 Methods and 2 Constructors:

  • Class should have two constructors. A default constructor that initializes the class with the current server DateTime and a constructor that allows you to pass a DateTime in as a parameter to initialize it.
  • Method IsTodayInWeekend() – Return true/false if the current date is in the weekend.
  • Method IsCurrentYearLeapYear() – Returns true/false if the current year is a leap year. Hint : Look at the DateTime class documentation
  • Method TotalDaysInMonth() – Returns how many days are in the month currently represented by this Date. Example: is a leap year, February has 29 days but only 28 otherwise. Hint: Look at the DateTime class Documentation
  • Method GetTodayHolidayName() – Returns the name of a US holiday or “Not a Holiday” for the current date.

List of US Holidays can be found here, you need to encode at least 5: http://en.wikipedia.org/wiki/Public_holidays_in_the_United_States

Note: It is ok to just use 2015 dates for dates that change every year.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.