Homework 2
CSSE 221 – Fundamentals of Software Development Honors
Fall 2008–2009

Recall the Due Dates and (from the syllabus) the Late (and early) Assignment Policy and guidelines for maintaining Academic Integrity.

Also recall that you can get help on any of these problems during the CSSE lab assistant hours, and you can use the Assignments Discussion Forum on Angel to discuss, clarify, or get help on these problems.

Things to do

  1. Complete the JavaEyes exercise from Sessions 1 and 2, if you have not already done so.
  2. Continue reading from Chapters 1 through 6 of Big Java, as necessary.
  3. Take the Capsule Group 1 Topic Preference Survey in Angel ~ Lessons ~ Assessment ~ Surveys.

  4. Do the written problems below.

Written problems

Write your answers to these questions. Turn your answers in via the appropriate Homework Drop Box on Angel.

Find the documentation for the BigInteger class from the Java API documentation. Use the BigInteger documentation to answer these questions:

  1. In 10 words or less, what is a BigInteger?
  2. Give an example of an application for which BigInteger might be useful.
  3. Suppose that you have BigInteger variables x, y, and z. Write the line of code that would store in z the sum of x and y.
  4. Does the line of code in the previous question change the values of x or y?
  5. Does BigInteger implement the Comparable interface?
  6. If a class implements Comparable, what method must that class define?
  7. Give a short example of the use of the compareTo method of Comparable applied to BigIntegers.
  8. In the BigRational project, you will implement the BigRational class. As the name suggests, a BigRational is the quotient of two arbitrarily-big integers.
    1. What fields should a BigRational have? What should be the types of those fields?
    2. What arguments should the constructor of a BigRational take?