Question: 3. (Program) a. Create an operator function for the Date class in Class 11.1 that compares two Date objects and returns a Boolean value of




3. (Program) a. Create an operator function for the Date class in Class 11.1 that compares two Date objects and returns a Boolean value of true if the first date is larger than the second; otherwise, it should return a false value. The "larger than" algorithm for this comparison operator function is the following: Accept one date as the current object being evaluated and a second date as an argument Determine the later date with the following procedure: Convert each date to a long integer value in the form yyyymmdd, using the algorithm in Exercise 2 Compare the corresponding integers for each date If the first date's long integer value is larger than the second dates long integer value, Return true Else Return false b. Include the function written for Exercise 3a in a complete program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
