Define a class that models a simple date using integer month, day, and year attributes. Write a program that does the following:

  • Creates a collection of dates using an STL container.
  • Displays the colletion using the STL 'foreach' algorithm.
  • Sorts the collection in descending date order using the STL 'sort' algorithm and displays the sorted collection using the STL 'foreach' algorithm.
  • Counts and displays the number of odd dates in the collection using one or more STL algorithms. An odd date is a date having an odd day number (1 - 31).

Use the following dates: 12/12/2012, 12/31/2013, 10/12/2012, 6/18/2013, 4/30/2013, 9/25/2012. You do not have to prompt for user input. Submit a screen capture of program output along with your source code.

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.