Lab Assignment 4
CS202, Summer 2006

Please upload your source code files using CSNS. Note that file uploading will be disabled automatically after the lab ends, so please turn in your work on time.

1.(10pt) Come up with an example to show that the default access modifier (i.e. no access modifier is specified) is not public, private, or protected.

2. Class hierarchy of Document

All the member variables in the classes must be private. You may create any constructors, and getter/setter methods if necessary.

if( obj.toString().indexOf(keyword) >= 0 ) System.out.println( obj );

3.(10pt) Implement a class CDAccount which inherits from the Account class. A CD account has the restriction that a transaction (deposit, withdraw, or transfer) can only occur during the one week grace period after an account matures. For simplicity, we assume that all CD accounts have the same 30-day term. Also for this exercise, you do not need to implement the transfer method.

HINT: to calculate the difference between two dates, you may consider using the getTimeInMillis() method in the Calendar class. getTimeInMillis() returns the current time in milliseconds since January 1, 1970.