Fund. CS II (CS152 2004F)

Homework 20: Exceptional Comparison

Due: Wednesday, 29 September 2004

Suppose we are creating a class, Assistant, that performs many common activities. One such activity is, given two objects, a and b, to determine which of the two is smaller. Suppose we call that the corresponding method min.

/**
 * Find the smaller of two comparable objects.
 */
public Comparable min(Comparable a, Comparable b)

Through analysis, we determine that

Implement and test min.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Wed Dec 8 10:36:54 2004.
The source to the document was last modified on Tue Sep 28 10:58:04 2004.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS152/2004F/Homework/20.html.

You may wish to validate this document's HTML ; Valid CSS! ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu