Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rational Numbers in Java
Java
tree: 5d280b6cba

refactored the rational test run class to allow multi-digit numerator…

… or denominators, and simplified the input pattern matching
latest commit 5d280b6cba
@banderson authored

README.mdown

Rational - a Java implementation of Rational numbers

A simple assignment to implement the basic functionality of Rational Numbers:

  • Add
  • Subtract
  • Mutlipl
  • Divide
  • Reduce to lowest form (using Euclidean algorithm)

Source Files:

  • Rational.java: basic Rational functionality described above
  • RationalTest.java: JUnit test class to exercise functionality to verify accuracy
  • RationalTestRun.java: test class to exercise functionality in main() for those without JUnit
  • MathHelper.java: basic helper functions for determining LCM and GCD for use in reducing fractions
Something went wrong with that request. Please try again.