Assignment 1: Using Strings, arrays, and classes

This is a short assignment that illustrates the basics of strings, arrays, and using object references. In it you will process some huge numbers that are supplied as command-line arguments.

  1. Declare an array of BigIntegers. The BigInteger class is defined in java.math. The size of the array should equal the number of command line arguments.
  2. Get the strings from command line and use them to initialize the array of BigInteger declared above.
  3. Then, for each pair of numbers (i.e. if there are 3 numbers, there are three pairs: (i1,i2), (i1,i3), (i2,i3), determine and output in a respectable format the two numbers, their sum, product, gcd, and result of calling compareTo and equals.
  4. Then, in the interest of nonsense, form two numbers: one is i1 i2 i3 ... in, treated as one huge number; the other is in i(n-1) ... i1, also treated as one huge number. Use string concatenation to concatenate the command line arguments, and then construct the BigIntegers. Once you've done that, compute the same set of information as above.
  5. Finally, optimize the concatenation by using a StringBuffer.

Because the AUL is not yet open, this assignment will be ungraded and uncollected. Needless to say, I expect you to do it anyway.