Hello! I'm doing a bit of homework working with classes. The goal is to create a Date class that store a calendar date. I'm having a bit of trouble writing the member functions for the class specifically Show(), SetFormat(), and Compare(). The requirements for the member functions are as follows. Show( ): output date to screen; there is more than one possible format and the class needs to store the format setting. Show should use format setting to determine output. Should start in "default"; possible formats should include: 1. M/D/Y 2. mm/dd/yy 3. month D, Y (ex. Oct 13, 2014).
I'd like to know what it means by "store a format setting" and how to accomplish this. Where do I store it? Another function? SetFormat(): allows to change format setting. For this I would like to know how write it so that when a letter is entered it will display in format until changed again. Lastly, Compare(): function should compare two Date objects (the calling object and the parameter), and should return: -1 if the calling object comes first chronologically, 0 if the objects are the same date, and 1 if the parameter object comes first chronologically. I just don't know how to code it to compare two objects. It's a work in progress so I apologize for the mess. I included a commented out block at the end for when I was trying to work on the Setformat() function. I think I was on to something. Any and all help is appreciated!