星期一, 5月 28, 2007
Homework 5-28-2007: Sorting
Study Display 6.1, and then write a program that can sort numbers in ascending order.
Lab Static Method II
(1st ed.) Do Project 3 of Chap 5. Define a Complex class and write a program to compute (2+3i)+(4+5i) in Java.
(2nd ed.) Do Project 7 of Chap 5. Define a Complex class and write a program to compute (2+3i)+(4+5i) in Java.
Note:
Implement a static method and a nonstatic method using overloading. The results of these two methods should be the same.
(2nd ed.) Do Project 7 of Chap 5. Define a Complex class and write a program to compute (2+3i)+(4+5i) in Java.
Note:
Implement a static method and a nonstatic method using overloading. The results of these two methods should be the same.
星期三, 5月 23, 2007
星期一, 5月 21, 2007
Lab Static Method
Study Display 5.2.
Using static variables and static methods to implement the class Fibonacci such that
the first call to Fibonacci.next()
returns 2, the second returns 3, and then 5, and so on.
Using static variables and static methods to implement the class Fibonacci such that
the first call to Fibonacci.next()
returns 2, the second returns 3, and then 5, and so on.
Lab Java Constructor
Use Display 4.14 to call 4.13 (2nd ed.) or
Display 4.12 to call 4.11 (1st ed.).
After you finish the above, try the following
Date birthday = new Date("Jan",1,2000);
birthday.Date("Feb",1,2000);
birthday.setDate("Feb",1,2000);
birthday=new Date("Mar",1,2000);
Display 4.12 to call 4.11 (1st ed.).
After you finish the above, try the following
Date birthday = new Date("Jan",1,2000);
birthday.Date("Feb",1,2000);
birthday.setDate("Feb",1,2000);
birthday=new Date("Mar",1,2000);
星期五, 5月 18, 2007
5-28-2007 第三次上機測驗
Java 基本知識,問答題 50%, 範圍課本 Chap. 1~Chap. 5, Open book
Java 物件導向程式設計,50%, 範圍課本 Chap. 1~Chap. 5, Open book
Java 物件導向程式設計,50%, 範圍課本 Chap. 1~Chap. 5, Open book
星期二, 5月 15, 2007
Homework 5-14-2007
Define a Complex class and write an object oriented program to compute (2+3i)+(4+5i) in Java.
星期一, 5月 14, 2007
星期一, 5月 07, 2007
Lab Counter
Define a class called Counter whose objects count things. An object of this class records a count that is a nonnegative integer. Include methods to set the counter to 0, to increase the count by 1, and to decrease the count by 1. Include an accessor method that returns the current count value and a method that outputs the count to the screen. Write a program to test
counter.reset();
counter.inc();
counter.inc();
counter.dec();
counter.output();
Homework 5-7-2007: Overloading in Java
Study Display 4.11 and use Display 4.12 to call 4.11. (2nd ed.)
Study Display 4.9 and use Display 4.10 to call 4.9 (1st ed.)
Study Display 4.9 and use Display 4.10 to call 4.9 (1st ed.)
訂閱:
文章 (Atom)