70-483 question 202 discussion


You are developing a class named Temperature.
You need to ensure that collections of Temperature objects are sortable.
You have the following code:

Which code segments should you include in Target 1, Target 2 and Target 3 to complete
the code? (To answer, drag the appropriate code segments to the correct targets in the
answer area. Each code segment may be used once, more than once, or not at all. You
may need to drag the split bar between panes or scroll to view content.)

Created 5 months, 1 week ago by aniioocka


Correct answer for Target 3 is this.Fahrenheit.CompareTo(otherTemperature.Fahrenheit); Source: https://msdn.microsoft.com/en-us/library/system.icomparable.compareto(v=vs.110)


Actually, I think both solutions are correct, though yours is more logical - the one given just orders from high temperature to low rather than from low temperature to high.