CSci 581-01: Special Topics in Computer Science
Object-Oriented Design & Programming
Fall Semester 1997

Assignment #3
Due Midnight, 6 October**

** Assignment #4 will likely be due on the same day, so I advise you to do this assignment by 29 September if possible


Develop a Java class for fractions (i.e., rational numbers). You can use a pair of integers to represent the numerator and denominator of the fraction.

Your class should include the following:

Design questions: How do you handle the reduction of the fractions to the lowest common denominator? How do you represent zero? How do you represent negative values? Do you use a unique representation for each value (e.g., 1/3, 2/6, and -1/-3 in just one way)? How do you handle division by zero?

Document the class appropriately!

Test the program appropriately! I would prefer you to write a main method with appropriate tests embedded so that all I need to do is to execute the class. If necessary, include any testing output from your test run.

Submit the source code and any testing output via email to cs581@hal.cs.olemiss.edu.


UP to CSci 581 Assignments page?


Copyright © 1997, H. Conrad Cunningham
Last modified: 22 September 1997.