2008年11月7日 星期五

lab class definition 2 11-07-2008

因為private month,所以沒有辦法System.out.println(date.month);



































lab counter 11-07-2008

1.Define a class called Counter whose objects count things.











2.



Homework 10-31-2008

1.










2.












3.









2008年10月31日 星期五

Homework 10-24-2008

1. Write a program to generate the series 1, 1, 2, 3, 5, 8, 13, ...
The series has a property that the third number is the sum of the first and second numbers. For example, 2=1+1, 3=1+2, and 5=2+3.











2. Write a program to generate the following table of arithmetic expressions

1*1=1 1*2=2 1*3=3 ... 1*9=9
2*1=2 2*2=4 2*3=6 ... 2*9=19
...
9*1=9 9*2=18 9*3=27 ... 9*9=81