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
- Complete the JavaEyes exercise from Sessions 1 and 2,
if you have not already done so.
- Continue reading from Chapters 1 through 6 of Big Java,
as necessary.
- Take the Capsule Group 1 Topic Preference Survey
in Angel ~ Lessons ~ Assessment ~ Surveys.
- 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:
- In 10 words or less,
what is a BigInteger?
- Give an example of an application for which BigInteger might be useful.
- 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.
- Does the line of code in the previous question
change the values of
x or y?
- Does BigInteger implement the Comparable interface?
- If a class implements Comparable, what method must that class define?
- Give a short example of the use of the compareTo
method of Comparable applied to BigIntegers.
- In the BigRational project,
you will implement the BigRational class.
As the name suggests,
a BigRational is the quotient of two arbitrarily-big integers.
- What fields should a BigRational have?
What should be the types of those fields?
- What arguments should the constructor of a BigRational take?