2008年9月26日 星期五

W2lab2

Simple Arithmetics
Write a Java program that displays the results of the expressions 15/4, 4/15, 15%4, 4%15. Calculate the values of these expressions manually to verify that the displayed values are correct.

W2lab1

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.

2008年9月25日 星期四

H.W01

Homework 9-19-2008

1. Explain bytecode, JVM
a. bytecode
The java compiler translates your program into a language called byte-code,which is the machine language for a fictitious computer.It is easy to translate this byte-code into the machine language of any particular computer.Each type of computer will have its own interpreter that translates and executes byte-code instructions.
b. JVM(Java Virtual Machine)
Byte-code is the machine language for a fictitious computer called the Java Virtual Machine.

ByteCode 是給予 JVM 執行的一種虛擬機器碼,也就是給於 JVM 的指令‧
反過來說,JVM 就是 ByteCode 的解譯程式

2. Explain class, object
class類別 object物件
A java program works by having things called objects perform actions. The actions are known as methods and typically involve data contained in the objects. All objects of the same kind are said to be of the same class .
A class is a category of objects.

類別是一種物件導向計算機程式語言的構造,是創建物件的藍圖,描述了所創建的物件共同的屬性和方法。
在軟體系統中,物件具有唯一的標識符,物件包括屬性和方法,屬性就是需要記憶的信息,方法就是物件能夠提供的服務。在物件導向的軟體中,物件是某一個類的實例。

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


2008年9月19日 星期五

lab2

Java for Scientific Computation


lab1

Get familiar with JBuilder


error



2008年9月12日 星期五

My intro

哈囉 這是我第一個網誌


很爛,毫無打算經營的需要.
因為...
這只是用來交作業