Class RationalNumberClient

java.lang.Object
it.unimi.di.prog2.s10.RationalNumberClient

public class RationalNumberClient extends Object
A class to exercise a RationalNumber.
  • Constructor Details

    • RationalNumberClient

      private RationalNumberClient()
      .
  • Method Details

    • main

      public static void main(String[] args)
      Tests some methods of BoundedIntQueue.

      Reads a list of pairs of integers from the standard input, corresponding to the numerator and the denominator of a sequence of rational numbers \( q_i \). Computes the sequence of rational numbers given by \( r_0 = 0 \) and \( r_{i+1} = q_i + r_i \cdot q_i \). Then compares the last computed rational number with the rational number given by the pair of integers given as command line arguments emitting true in the standard output if they are equal, false otherwise.

      Parameters:
      args - the numerator and denominator of the resulting fraction.