2006-01-15

Tower of Hanoi







Recursion


2006-01-03

Lab 1-02-2006 modular sorting

sort部分,上次是用別的方式寫的
這次改用氣泡排序法

2006-01-02

Lab 12-26-2005 (2)

使用教室的電腦成功了 (一樣的步驟,也許是電腦環境設定問題吧....)
==================================================



失 敗了>"< 這部分的概念不是很懂...
不知從何修正起
大概是環境設定的一些東西吧...??

程式碼:


在dos裡面會一直出現以下的訊息

2005-12-26

"Lab 12-26-2005 (1)"

public class yusj
{
public static void main(String[] xxx)
{
System.out.println(xxx[0]+" "+xxx[2]+xxx[1]);
}
}

Lab 12-19-2005 Sorting


Homework 12-19-2005 Lab Equal Arrays


2005-12-19

Lab Complex







public void setNumber(int r, int i)
{
this.r=r;
/*如果是number1.setNumber
this.r指的是number1的r
也就是執行動作的物件就是this
....恩...剛剛突然一陣混亂*/
this.i=i;
}

-----------------------------------
可是如果改寫成
private Complex number;
public void setNumber(int r,int i)
{
number.r=r;
number.i=i;
}
似乎並沒有立即的語法錯誤
可是run起來還是有誤
而且看不太懂....
如下

Homework 12-12-2005 Counter II





恩...其實對於toString的部分
感覺上不是很懂...=.=a

2005-12-18

Lab 12-12-2005 (2) Static Class

2005-12-12

Lab Constructors










Homework 12-5-2005









未設定temp1時,temp1的輸出

The temperature = 0.0 degrees c
將temp2設定為0度C
The temperature = 0.0 degrees C
將temp1的scale更改為F
The temperature = 0.0 degrees F
設定temp1的度數部分為212
The temperature = 212.0 degrees F
設定temp2的degree和scale
The temperature = 100.0 degrees C
將100度c的temp2轉換成華氏
The temperature = 212.0 degrees F
temp1(212度F)是否相等/高/低於temp2(由100度C轉成的212度F)?
Are temp1 and temp2 equal? true
Is temp1 greater than temp2? false
Is temp1 less than temp2? false
設定temp1=0度C,轉換成如下(兩者相等)
The temperature = 32.0 degrees F
設定temp1=-40度F,轉換成如下(兩者相等)
The temperature = -40.0 degrees C

Lab 12-5-2005 (2) Overloading







不曉得為什麼跑出來的結果像是亂碼
也確認過他的型態等等問題
也沒有語法上面的錯誤
總之就很奇怪

後來做些更改
在class DateSixthTry的地方增加
public void outPut()
{
System.out.println(month+" "+day+","+year);
}
然後
在class OverloadingDemo的地方

System.out.println(date1);
System.out.println(date2);
System.out.println(date3);

date1.outPut();
date2.outPut();
date3.outPut();
之後就可以正常顯示結果如下
至於之前為什麼還是亂碼...
我還是不曉得....>"<