CSSE 220 – Object-Oriented Software Development
Homework 8
Objectives
Practice with arrays and ArrayLists.
Tasks
-
Complete the assigned reading for the next session: § 9.1–9.5. As you read, see if you can answer the self-check questions. If there is something you do not understand, make note of it so you can ask about it
in class.
- Programming:
- Your programming work for this assignment must be done in the
ArraysListsAnd2D
project inside Eclipse.
Check out this project. Note that the "grace period"
described in HW7 also applies to the Fractions
part of this assignment. TicTacToe should be completed
by Session 9 day at 8:05 AM.
(3 points) TicTacToe: Finish the in-class exercise.
Postponed to HW9
because we did not get this far in class.
- (8 points) Fractions. Write (in the
FractionArrays
class) and test (by adding code to main()
in the
FractionArrays
class) the following methods.
-
/**
*
Find
the
largest
denominator
from
among
the
Fractions
in
the
array;
*
@param
a
array
of
Fractions
*
@return
largest
denominator
(0
if
the
array
is
null
or
empty)
*/
public
static
int
largestDenominator(Fraction [] a)
-
/**
*
Find
and
remove
all
occurrences
of
the
largest
fraction
in
a.
*
The
order
of
the
remaining
elements
should
not
be
changed.
*
@param
a
an
ArrayList
of
Fractions
*/
public
static
void
removeLargest(ArrayList<Fraction>
a)
- Continue the Pascal Triangle exercise from HW7.
Turn-in Instructions
Turn-in your programming work by committing it to your SVN repository.