星期一, 3月 17, 2008

星期一, 3月 10, 2008

Homework 3-10-2008: String Processing

Do Project 5 of Chap. 1 on Page 56.

Write a program that starts with a line of text and then outputs that line of text with the first occurrence of "hate" changed to "love". For example, a possible sample output might be

The line of text to be changed is:
I hate you.
I have rephrased that line to read:
I love you.

Hint: You may consider use the methods: indexOf(A_String) and substring(Start, End) in your program.

請務必攜帶課本

  • 從 3/ 17 開始,將開始登記未攜帶課本者,同用一桌者至少須有ㄧ本。版本不拘。新舊皆可。
  • 尊重智慧財產,不可使用影印本。

Lab: Simple Calculation

Suppose you are a landscape architect who charges $5,000 per mile to landscape a highway, and suppose you know the length in feet of the high way you are working on. Write a Java program to calculate the price you charge when the length is 6000 and 4000, respectively.

Hint: There are 5280 feet in a mile.

星期一, 3月 03, 2008

Homework 3-3-2008

Due 3/10/2008 at 18:50

"tell me and I'll forget; show me and I may remember; involve me and I'll understand"

1. Explain bytecode, JVM
2. Explain class, object
3. Reading Assignments:
Read 1.1, 1.2, 1.3 of Textbook

4.1 Write a Java program as follows:

Let i=2;
Print i;
Print 2 * (i++);
Print i;

Ans: 2, 4, 3

4.2 Write a Java program as follows:

Let i=2;
Print i;
Print 2 * (++i);
Print i;

Ans: 2, 6, 3

4.3 Write a Java program as follows:

Let m=7, n=2;
Print (double) m/n;
Print m/ (double)n;

Ans: 3.5, 3.5

Lab 2 Java for Scientific Computation

Do Project 4 on Page 55. (3rd Edition)

Do Project 4 on Page 56. (2nd Edition)

Do Project 1 on Page 54. (1st Edition)

artificial sweetener 人工代糖(過量可以致癌)
diet soda pop 減肥可樂
lose weight 減肥

Lab Get familiar with JBuilder

Do Display 1.1