星期一, 5月 29, 2006

Homework 5-29-2006 Lab Squared Numbers in an Array

Write a program that given an array of integers, return the squares of the array.
The sqaures are computed in a separate method rather than in the main method.


Cookie

Lab modular sorting

Write a sort method which takes a double array as parameter
and returns the sorted array. Call this method in a main program.

Hint: The lab is a rewriting of Lab Sorting
to make the sorting procedure a reusable method.
Cookie

星期一, 5月 15, 2006

Lab Sorting

Study Display 6.1, and then write a program that can sort 5 numbers in ascending order. The 5 numbers are input by the user.

星期一, 5月 08, 2006

Lab Static Method, Part 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.

Homework 5-8-2005

Do Temperature Project, which is Project 7 (2nd ed.) or Project 3 (1st ed.).

星期一, 5月 01, 2006

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.

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);