Sunday, January 30, 2011

Week of Jan. 31, 2011

MON

Download ForEach.java from box.net (above)
Click Code Samples --> For Loops

Assignment 1
Add the following
1.  Create an array of String objects called Presidents.
    Add any 10 presidents.
    Print out using both a traditional for loop and a foreach loop.
2.  Create an array of double values and initialize with any five double values.
    Print out with both for loop styles.
3.   Create a separate class called Friend (use the class template by right clicking in Smultron)
     Add private instance data:
     long phoneNumber;
     Overload the constructor to take long phoneNumber.
     Create a get method for phoneNumber.
     Modify the toString method to show name and phoneNumber.
4.  Create an array of Friend objects called friends.
     Add five friends to friends.
     Print out with both for loop styles.

Assignment 2
Duplicate the Library project folder
Modify the Library class so that it uses an ArrayList of Book objects instead of an array.
Make all necessary modifications to accessor/mutator methods.

HOMEWORK
READ P. 358 - 363
ANSWER P. 377 Self-Review 6.3, 6.4, 6.6, 6.12


TUE  - FRI
check back for further details