fractions calculator on Java