2007年10月5日 星期五

Lab: Adding Links on Your Blog

1. Check into your blog homepage.
2. Enter "自訂"
3. Select "連結清單"
4. Write down "http://javaatcycu.blogspot.com/" and the title as "Java物件導向程式設計"
5. Also add your own favorite links.

2007年9月28日 星期五

Homework 9-28-2007 String Processing

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.

Lab 9-28-2007 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.


Ans:
如果是4000feet的話,需要3787.878787878788元
如果是6000feet的話,需要5681.818181818182元

Homework 9/21/2007

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

1. Explain bytecode, JVM
Byte-Code:可將我們所寫的程式經過編譯後產出的中間碼。
JVM:Java Virtual Machine.一個以軟體模擬出來的機器環境,可用來執行java 的 byte code。

2. Explain class, object
class是object的集合,用來描述屬性(Property)跟方法(Method)。
object是物件,包含在CLASS裡



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

2007年9月21日 星期五

Lab 2



所以老鼠如果一天吃了10g的人工代糖會死去
也就是大約喝了10公升的汽水
如今假設一個人的體重為80kg
則要喝多少汽水才會死去?
所以人一天大約要喝8000公升就會有生命危險

Lab Get familiar with JBuilder


Do Display 1.1

2007年9月18日 星期二

Homework 9/14/2007

1. Watch The Inside Story (Video), write your words on the development and inventor of Java.

目前Java的主要應用在於電子商務及企業電子化的部份,除此之外,Java也漸漸的在消費性電子平台上發揮它跨平台的特性,各家的手機場商、PDA廠商也紛紛的發表內建JVM的系統,Java在這方面跟其它的程式語言比較起來,Java的未來可以說是一片光明。




2. List at least 5 applications of Java. You must provide the references you used. We recommend Google Search engine.

1.手機上的Java Games

2.Java智慧卡(廣泛應用於通信、交通、金融、證卷和保險等領域)

3.Java Virtual Machine (JVM)爪哇虛擬機器

4..停車繳費系統


5.Java平台在藍光光碟設備上的集成