2008年12月26日 星期五

H.W09

Lab Hanoi Tower




2008年12月21日 星期日

我有話要說

上學習計概修C++對程式很頭痛,這學期修老師的Java讓我對寫程式不至灰心,重燃希望
object class method variable ...層層遞疊,完整的語言敘述表達一個執行句子
其實學程式也是要大量練習,不能只靠課堂聽聽就能完全融會貫通,而且愈到後面還要連
貫前面提到的,作業習題純熟度依然不夠,所以考試可能不盡理想,雖說都努力做過一遍.

我這學期選修電子商務學程,下學期要修網際網路應用系統設計聽說比Java的技巧和要
求困難數倍,所以進步的方向無限,畢竟寫一個完美且複雜程式還要花點巧思靈感
嚴謹的程序步驟,邏輯推導能力.
也謝謝老師不厭其煩的指導,下次能再修老師開的課,愈到問題都要解決,這樣對設計程式
的功力才會進步.

2008年12月19日 星期五

LAB19

Lab Factorial


LAB18

Lab Recursive Method

2008年12月18日 星期四

LAB17

Lab Static Method
















LAB16

Lab Java Constructor




2008年12月15日 星期一

H.W08

Homework 11-28-2008
Lab Overloading




2008年12月2日 星期二

2008年11月28日 星期五

Lab15

ADT






















H.W07

Homework 11-21-2008
Fraction equality test

















2008年11月27日 星期四

H.W06

Homework 11-21-2008
Fraction Addition



























2008年11月21日 星期五

LAb14

Class Definition 3


























H.W05

Homework 10-31-2008




















2008年11月19日 星期三

H.W03(補)

Homework 10-3-2008

project4














project5













project6














project7












2008年11月7日 星期五

Lab13

class definition 2










































Lab12

counter

















2008年10月31日 星期五

H.W04

Homework 10-24-2008

1. Write a program to generate the series 1, 1, 2, 3, 5, 8, 13, ...
The series has a property that the third number is the sum of the
first and second numbers. For example, 2=1+1, 3=1+2, and 5=2+3.







2. Write a program to generate the following table of arithmetic expressions
1*1=1 1*2=2 1*3=3 ... 1*9=9
2*1=2 2*2=4 2*3=6 ... 2*9=19
...
9*1=9 9*2=18 9*3=27 ... 9*9=81



2008年10月29日 星期三

LAB11

Finding the max of a list of numbers


2008年10月24日 星期五

LAB10

Finding the max of three numbers


LAB9 right


LAB9

Tax Calculation


2008年10月2日 星期四

LAB4

Lab:String Processing





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