Name __________________________ Date:
AP CS Java - Mr. Merlis Block 4 ACE
Day 30 – WHAT’S GOING ON
TODAY’S AGENDA
-
Go over 20-40 from the review book.
-
Discuss JAVA 1.5 in terms of
ArrayList.
-
All labs should be done by now.
Discuss lab 2a and 3a.
LABS 2a
& 3a
Labs 2a and 3a ARE the same as Labs 2 and 3.
They should be done INSIDE THE THE SAME PROJECT.
Add the letter “a” to the end of the new classes you will
create (otherwise the same name as 2 and 3)
All you must do is:
USE JAVA
1.5 à Specifically Two Tasks
-
Cast your
ArrayLists
-
Use the
“for : each” loop
Labs 2a and 3a should be completed by the end of class on THURSDAY.
Consider this your homework.
// Returns the sum of the elements of a
int sum(int[] a) {
int result = 0;
for (int i : a)
result += i;
return result;
}