Mutating ArrayList; Implementing loops.
Part 1: Complete the following exercises from Lab 9:
Using ArrayList with Mutation: The four methods listed under Task 2
After you understand how the while
loop works,
design two variants of the method that produces a new
ArrayList
that contains all elements of the original
list that satisfy the given ISelect
predicate.
Test the methods by producing all albums released before the given year.
Design and test two variants of the andMap
method
that determines whether all elements of a given list satisfy the
given ISelect
predicate.
Test the methods by checking whether all albums were released before the given year.
Due Date: Tuesday, March 27, 2007 at 9:45 am.
The following two parts are not due with this assignment. They will become a part of the Assignment 10 next week:
Part 3: Selection Sort for ArrayList
pdf html