Question: You're assignment is to write the code for the compare function for this class. This compare function has a small twist. There are two arguments,
You're assignment is to write the code for the compare function for this class. This compare function has a small twist. There are two arguments, the first is an enum tag telling the function which field to use for comparison, the second is the compared Record. As noted in the header file, the function returns an int. The return value of zero indicates that the two objects are the same based on the field requested. Positive return values mean the compared object is lesser or sequentially before negative mean the compared object is greateror sequentially after
The test code included with this lab will sort a set of Records based.on your compare function. The sort is already written sortBy When
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
