星期五, 6月 26, 2009
星期五, 6月 19, 2009
星期一, 6月 15, 2009
學期成績
配分比例如下
Participation (出席&小考) 50%, Lab 30%, Homework 20%
評分重點
出席: 缺席ㄧ次扣總分五分,三次以上得不及格
小考: 兩次分數加總平均(請假者個案處理)
平時分數最高30分,發問或答題者酌予加分,最高以加到20分為上限。
Lab: 完整性(是否完成所有上機),準時性,原創性,工整性(程式內容條理是否清晰,說明是否清楚),正確性
Homework: 完整性,準時性,原創性,工整性,正確性
有話要說(有話就說,無關記分)
ps: 文章意見區關閉,請直接留言在有話要說
星期日, 6月 14, 2009
Lab Hanoi Tower
The pseudocode for Hanoi Tower is as follows:
solve(N, Src, Aux, Dst)
if N is 0 return
solve(N-1, Src, Dst, Aux)
Move N from Src to Dst
solve(N-1, Aux, Src, Dst)
Write the Java program based on the pseudocode in the above.
solve(N, Src, Aux, Dst)
if N is 0 return
solve(N-1, Src, Dst, Aux)
Move N from Src to Dst
solve(N-1, Aux, Src, Dst)
Write the Java program based on the pseudocode in the above.
Lab Factorial
Write a Java program that computes N! where N is a positive integer.
Hint:
public static long factorial(int n)
Hint:
public static long factorial(int n)
Lab Recursive method
Write a recursive method to compute Fibonacci series.
Hint:
1.
fib(n)=fib(n-1)+fib(n-2)
2.
public static long fib(int n)
Hint:
1.
fib(n)=fib(n-1)+fib(n-2)
2.
public static long fib(int n)
星期五, 6月 12, 2009
星期日, 6月 07, 2009
Quiz 6.8.2009
1. Design a static method that can compute the addition of fractions. You must first define Fraction class then write a demo program to verify the class program.
2. Design a non-static method that can compute the addition of fractions. You must first define Fraction class then write a demo program to verify the class program.
3. 列舉至少三個Java記憶體管理的特性
4. 列舉至少三個Java程式的風格
5. Let i, j be two integers. Write a Java program to exchange their values. Please make sure you have good styles of making comments, naming variables, and indenting.
6. Write a complete Java program that uses a for loop to compute the sum of the odd numbers between 1 and 25.
7. 列舉至少三個 API (Application Programming Interface).
8. 列舉 ADT (Abstract Data Type) 的特性.
9. Write a Java program to calculate the cosine function as follows:
Cos(x)=1 - x 2 /2!+ x 4/4!- x 6/6!...
10. Write a Java program to calculate the sin function as follows:
sin(x)=x - x 3/3! + x5/5! - x7/7! ...
11. 請解釋 public static final PI = 3.141592654 中, public, static, final 的意義。
12. 為什麼 static method 不能呼叫 nonstatic method?詳細說明之。
13. 舉三個例子 Object
14. 舉三個例子 Method
2. Design a non-static method that can compute the addition of fractions. You must first define Fraction class then write a demo program to verify the class program.
3. 列舉至少三個Java記憶體管理的特性
4. 列舉至少三個Java程式的風格
5. Let i, j be two integers. Write a Java program to exchange their values. Please make sure you have good styles of making comments, naming variables, and indenting.
6. Write a complete Java program that uses a for loop to compute the sum of the odd numbers between 1 and 25.
7. 列舉至少三個 API (Application Programming Interface).
8. 列舉 ADT (Abstract Data Type) 的特性.
9. Write a Java program to calculate the cosine function as follows:
Cos(x)=1 - x 2 /2!+ x 4/4!- x 6/6!...
10. Write a Java program to calculate the sin function as follows:
sin(x)=x - x 3/3! + x5/5! - x7/7! ...
11. 請解釋 public static final PI = 3.141592654 中, public, static, final 的意義。
12. 為什麼 static method 不能呼叫 nonstatic method?詳細說明之。
13. 舉三個例子 Object
14. 舉三個例子 Method
星期五, 6月 05, 2009
星期一, 6月 01, 2009
Homework 6-1-2009 Modular Sorting
Write a sort method which takes a double array as parameter
and returns the sorted array. Call this method in a main program.
Hint: The lab is a rewriting of Lab Sorting
to make the sorting procedure a reusable method.
and returns the sorted array. Call this method in a main program.
Hint: The lab is a rewriting of Lab Sorting
to make the sorting procedure a reusable method.
星期二, 5月 26, 2009
第二次小考 預告 6/8/2009
第一次小考答對6題(含)以上者,不須參加第二次小考。
Format: closed book, no computer, simple problem
Running time: 45 min.
Scope: Chap.4~Chap. 5
歷年小考
Format: closed book, no computer, simple problem
Running time: 45 min.
Scope: Chap.4~Chap. 5
歷年小考
一位校友對「為什麼在大學練習寫程式」留下新意見
畢業校友寫給我的回應,轉貼給各位參考。
Franson 已針對您的文章「為什麼在大學練習寫程式」留下新意見:
老師說得沒錯,程式真的很重要,我在網通相關領域業界工作了半年多,碰到很多資工領域背景的同仁,他們寫code能力真的很強。RD幾乎人人都要碰程式,就如英語一樣是目前業界工作基本要求。
但電子電機相關科系的同學也不用擔憂未來或是羨慕資工領域的學生,因為我們有嚴謹的理論訓練。在業界理論才是研發和解決問題的根基,就如同一本好書,想當然作者一定有很好的語言能力,但在他背後的一切才是構成這本好書的原動力。
所以,理論課程非常重要。
關於專題,老師在前面有很多很棒文章^^看了很有感觸阿!對我來說專題是全人教育的一部分,而非單純實作課程。在大學幾乎沒有白學的課程,選了就好好修,一定有會有收穫的。
Franson 已針對您的文章「為什麼在大學練習寫程式」留下新意見:
老師說得沒錯,程式真的很重要,
但電子電機相關科系的同學也不用擔憂未來或是羨慕資工領域的學生
所以,理論課程非常重要。
關於專題,老師在前面有很多很棒文章^^看了很有感觸阿!
星期一, 5月 25, 2009
為什麼在大學練習寫程式
寫程式是種邏輯訓練,頭腦體操,就算以後你不走這行,你還是因此變聰明了。並不會有所謂白學的問題。
事實上,很多電子系校友也不從事電子這行,例如有個管理顧問公司總經理就是我們系友,他雖然早就不碰電子,但是他還是覺得電子系給他的紮實工程背景訓練,是非常寶貴的一段學習經驗,並不會因為以後不走電子,現在學的東西全部白學。
電子系同學大多不重視寫程式,想不透是誰給他們寫程式不重要的錯誤概念,事實上寫程式對電子系同學的重要性絕對不亞於資工系,無論是通訊,數位,用到程式 的機會極高。現在的系統講究智慧,智慧從哪裡來? 當然是軟體。以手機為例,手機硬體大同小異,功能差異性主要來自軟體。所謂科技來自人性,軟體居功厥偉。
電子系不等於焊電路接麵包板而已,所以千萬不要輕視寫程式。寫程式的好處如下:
事實上,很多電子系校友也不從事電子這行,例如有個管理顧問公司總經理就是我們系友,他雖然早就不碰電子,但是他還是覺得電子系給他的紮實工程背景訓練,是非常寶貴的一段學習經驗,並不會因為以後不走電子,現在學的東西全部白學。
電子系同學大多不重視寫程式,想不透是誰給他們寫程式不重要的錯誤概念,事實上寫程式對電子系同學的重要性絕對不亞於資工系,無論是通訊,數位,用到程式 的機會極高。現在的系統講究智慧,智慧從哪裡來? 當然是軟體。以手機為例,手機硬體大同小異,功能差異性主要來自軟體。所謂科技來自人性,軟體居功厥偉。
電子系不等於焊電路接麵包板而已,所以千萬不要輕視寫程式。寫程式的好處如下:
- 以後工作用得上。現在的世界是買硬體送軟體,以後是買軟體送硬體。
- 訓練清晰頭腦,培養邏輯思考能力。
- 快速試做一個概念,因為你在耗時耗費實做之前,即可先用軟體程式模擬。如果結果不錯,再去實做不遲。
Lab: Static Method II
Define a Complex class with a static method for computing complex addition. Use (2+3i)*(4+5i) in your test.
程式能力
國外公司如微軟,Google應徵新人會考程式,國內手機, NB, GPS大廠其實也類似,最近我們的學生找Firmware Engineer工作,臨時被考程式能力。今年中央大學網路學習所的甄試在複試時也是當場測驗程式。
Lab Magic Parking Tower
A parking tower is out of order someday. If you park a Benz, you will end up with a Torben. Write a program to simulate this scenario. First create a class called CarParked which has a static method called outOfOrder. Name an object called yourCar, which happens to be a Benz. Your program should contain a class called CarParked and a test program called CarParkedDemo which test the method by CarParked.outOfOrder(yourCar).
Hint: You may study Display 5.14 to get some ideas.
Hint: You may study Display 5.14 to get some ideas.
星期一, 5月 18, 2009
Quiz 5-18-2009
1. Design a non-static method that can compute the addition of complexes. You must first define Complex class then write a demo program to verify the class program.
2. Design a static method that can compute the multiplication of fractions. You must first define Fraction class then write a demo program to verify the class program.
3. 列舉至少三個Java程式風格
4. 列舉至少三個Java記憶體管理特性
5. 6. Design a method that can compute the vector inner product. You must define Vector class in the first place. Write a demo program to verify your program works.
7. Give three examples of ADT (Abstract Data Type).
8. Give three examples of API (Application Programming Interface).
9. 10. Define a class called Counter whose objects count things. An object of this class records a count that is a nonnegative integer. Include methods to set the counter to 0, to increase the count by 1, and to decrease the count by 1. Include an accessor method that returns the current count value and a method that outputs the count to the screen.
11. 為什麼static method 不能呼叫 nonstatic method?詳細說明之。
12. 請解釋 public static final PI = 3.141592654 中, public, static, final 的意義。
13. 舉三個例子說明 Overloading
14. 舉三個例子說明 Constructor
2. Design a static method that can compute the multiplication of fractions. You must first define Fraction class then write a demo program to verify the class program.
3. 列舉至少三個Java程式風格
4. 列舉至少三個Java記憶體管理特性
5. 6. Design a method that can compute the vector inner product. You must define Vector class in the first place. Write a demo program to verify your program works.
7. Give three examples of ADT (Abstract Data Type).
8. Give three examples of API (Application Programming Interface).
9. 10. Define a class called Counter whose objects count things. An object of this class records a count that is a nonnegative integer. Include methods to set the counter to 0, to increase the count by 1, and to decrease the count by 1. Include an accessor method that returns the current count value and a method that outputs the count to the screen.
11. 為什麼static method 不能呼叫 nonstatic method?詳細說明之。
12. 請解釋 public static final PI = 3.141592654 中, public, static, final 的意義。
13. 舉三個例子說明 Overloading
14. 舉三個例子說明 Constructor
星期六, 5月 16, 2009
第二次小考 預告 6/8/2009
Format: closed book, no computer, simple problem
Running time: 45 min.
Scope: Chap.4~Chap. 5
小考目的主要在測驗學生基本能力,能夠面對問題,獨立去構思答案,不假他人既有成果。因此,不必求完美,只要掌握關鍵概念,就會給予高分。
歷年小考
Running time: 45 min.
Scope: Chap.4~Chap. 5
小考目的主要在測驗學生基本能力,能夠面對問題,獨立去構思答案,不假他人既有成果。因此,不必求完美,只要掌握關鍵概念,就會給予高分。
歷年小考
星期三, 5月 13, 2009
賀: 電子系精障研究 "全程護送 有障無礙" 獲得三創(創意創新創業)比賽全校第一名(科技創新獎)
此獎開始於2007年,由教育部教學卓越計畫主辦,每年挑選全校各系最精華專題成果,選出精華中的精華。獲得獎金五萬元。 恭喜 馬瑱賢 彭書敏 陳虹綺 。
另外,彭書敏 陳彥儒 陳虹綺 熊嬡菁 楊秉霖 黃俊達 精障研究 "展招開道 室內導航" 獲得三創比賽全校第四名。近日內將接受主要媒體採訪。
再次,謝謝各位就服員,老師給這些同學們三年來不斷的支持,鞭策與鼓勵。更要感謝的是所有參與實驗的精障者,你們用樂觀面對生命給我們極大的啟示。
另外,彭書敏 陳彥儒 陳虹綺 熊嬡菁 楊秉霖 黃俊達 精障研究 "展招開道 室內導航" 獲得三創比賽全校第四名。近日內將接受主要媒體採訪。
再次,謝謝各位就服員,老師給這些同學們三年來不斷的支持,
星期二, 5月 12, 2009
輔具科技夏令營 2009 開始報名
星期一, 5月 04, 2009
Lab Static Method
Define a Complex class with a static method for computing complex addition. Use (2+3i)+(4+5i) in your test.
Lab Math methods
Compute the following mathematical functions.
Math.round(3.2)
Math.round(3.6)
Math.floor(3.2)
Math.floor(3.6)
Math.ceil(3.2)
Math.ceil(3.6)
Math.round(3.2)
Math.round(3.6)
Math.floor(3.2)
Math.floor(3.6)
Math.ceil(3.2)
Math.ceil(3.6)
Lab Finding the max of three numbers
Write a static method that computes the maximum of three float numbers.
小考: 5-18-2009
Format: closed book, no computer, simple problem
Running time: 45 min.
Scope: Chap.4~Chap. 5
小考目的主要在測驗學生基本能力,能夠面對問題,獨立去構思答案,不假他人既有成果。因此,不必求完美,只要掌握關鍵概念,就會給予高分。
歷年小考
Running time: 45 min.
Scope: Chap.4~Chap. 5
小考目的主要在測驗學生基本能力,能夠面對問題,獨立去構思答案,不假他人既有成果。因此,不必求完美,只要掌握關鍵概念,就會給予高分。
歷年小考
Lab Method Overloading
依據Class definition 3,修改程式使其接受三種setDate
date1.setDate(1,2,2008);
date2.setDate("February",2, 2008);
date3.setDate(2008);
date1.setDate(1,2,2008);
date2.setDate("February",2, 2008);
date3.setDate(2008);
星期一, 4月 27, 2009
Homework 4-27-2009
Do project 2 of Chapter 4.
強烈要求同學一定要親自動手做,鼓勵同學將理論與實作密切配合。
相信只要同學真正的努力用功,縱使資質稍差,應該都可以學到Java程式設計之知識
強烈要求同學一定要親自動手做,鼓勵同學將理論與實作密切配合。
相信只要同學真正的努力用功,縱使資質稍差,應該都可以學到Java程式設計之知識
Lab ADT
Define a Complex class and write an object oriented program to compute (2+3i)+(4+5i) in Java.
The methods should include an access and a mutator.
The methods should include an access and a mutator.
Class definition 3
Do Display 4.7 (3rd, 2nd ed.) or 4.5 (1st ed.). Then use Display 4.8 to call 4.7.
Question
In Display 4.7, if the method setDate has the parameter as setDate(int month, int day, int year), what kind of changes should be made in its body of codes?
Question
In Display 4.7, if the method setDate has the parameter as setDate(int month, int day, int year), what kind of changes should be made in its body of codes?
星期一, 4月 13, 2009
Homework 4-13-2009 Fraction Multiplication
Write a program to implement a method that can multiply 2 fractions. You will implement a class called Fraction consisting of a numerator and a denominator. The multiplication of
2 fractions should be equal to a fraction.
Use 1/2 * 1/3 as the test.
Hints:
Fraction f1, f2;
f1.multiply(f2);
due date: 4/27/2009
2 fractions should be equal to a fraction.
Use 1/2 * 1/3 as the test.
Hints:
Fraction f1, f2;
f1.multiply(f2);
due date: 4/27/2009
lab Fraction equality test
Write a program to implement a method that can check whether 2 fractions are equal. You will implement a class called Fraction consisting of a numerator and a denominator. The equality test of 2 fractions should return a boolean value.
Use the following as the tests.
* 1/2, 2/4
* 5/6, 6/7
Hints:
Fraction f1, f2;
f1.equals(f2);
Use the following as the tests.
* 1/2, 2/4
* 5/6, 6/7
Hints:
Fraction f1, f2;
f1.equals(f2);
lab Fraction Addition
Write a program to implement a method that can do additions of 2 fractions. You will implement a class called Fraction consisting of a numerator and a denominator. The additions of
2 fractions should be equal to a fraction.
Use 1/2+1/3 as the test.
Hints:
Fraction f1, f2;
f1.add(f2);
2 fractions should be equal to a fraction.
Use 1/2+1/3 as the test.
Hints:
Fraction f1, f2;
f1.add(f2);
星期五, 3月 27, 2009
Homework 3-30-2009: counter
Define a class called Counter whose objects count things. An object of this class records a count that is a nonnegative integer. Include methods to set the counter to 0, to increase the count by 1, and to decrease the count by 1. Include an accessor method that returns the current count value and a method that outputs the count to the screen. Write a program to test
counter.reset();
counter.inc();
counter.inc();
counter.dec();
counter.output();
counter.reset();
counter.inc();
counter.inc();
counter.dec();
counter.output();
lab class definition 2
Study Display 4.4 (2nd ed. and 3rd ed.) or Display 4.2 & Display 4.3 (1st ed.) and then
1. Comment out date.setDate(6, 17, year); by // date.setDate(6, 17, year);
2. At the next line below, add date.readInput();
3. Run the program again. Fix any problems you may encouter along the way.
4. At the last line of your program, add System.out.println(date.month);
and see what happens. Why?
1. Comment out date.setDate(6, 17, year); by // date.setDate(6, 17, year);
2. At the next line below, add date.readInput();
3. Run the program again. Fix any problems you may encouter along the way.
4. At the last line of your program, add System.out.println(date.month);
and see what happens. Why?
星期二, 3月 24, 2009
第三度問鼎ACM ASSETS
ACM International Conference on Compuetrs and Accessibility (ASSETS) 是世界一流的國際學術會議,考驗著我們實驗室團隊的創新能力,論述能力,概念呈現,以及研究成果具體對身障者之貢獻。
需要我們正面迎對,張開眼睛,思考!
應該從研究中整理出條理,讓敘事邏輯清晰無比。
去除所有含糊不清,不知所云,莫名奇妙,模稜兩可的行事習慣。
過去連續兩年(2007-2008),我們辦到了,累積五篇論文,兩個獎。今年我们應該也做得到。
需要我們正面迎對,張開眼睛,思考!
應該從研究中整理出條理,讓敘事邏輯清晰無比。
去除所有含糊不清,不知所云,莫名奇妙,模稜兩可的行事習慣。
過去連續兩年(2007-2008),我們辦到了,累積五篇論文,兩個獎。今年我们應該也做得到。
星期一, 3月 23, 2009
Homework: 3/23/2009
Write a program to calculate average income by gender based on the following data, where F stands for female and M for male.
F 62,000
M 25,000
F 38,000
F 43,000
M 65,000
M 120,000
F 80,000
M 30,100
You should be able to allow users to type in a whole line such as F 80,000 followed by next line M 30,100.
F 62,000
M 25,000
F 38,000
F 43,000
M 65,000
M 120,000
F 80,000
M 30,100
You should be able to allow users to type in a whole line such as F 80,000 followed by next line M 30,100.
星期六, 3月 21, 2009
星期一, 3月 16, 2009
Lab Cosine
Write a Java program to calculate the triangular function as follows:
Cos(x)=1 - x 2 /2!+ x 4/4!- x 6/ 6!...
Cos(x)=1 - x 2 /2!+ x 4/4!- x 6/ 6!...
Lab Fibonacci
List the first 100 numbers and the ratio of
a number to its previous number, such as 1/1 = 1, 2/1 = 2, 3/2 = 1·5, 5/3 = 1·666..., 8/5 = 1·6, 13/8 = 1·625, 21/13 = 1·61538....
Want to know more about Fibonacci number
a number to its previous number, such as 1/1 = 1, 2/1 = 2, 3/2 = 1·5, 5/3 = 1·666..., 8/5 = 1·6, 13/8 = 1·625, 21/13 = 1·61538....
Want to know more about Fibonacci number
Homework 3-16-2009
1. Project 7 of Chap. 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
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
Lab Finding the max of a list of numbers
Based on your study of Display 3.8, write a code to find the max and min of a list of number.
For example, given 1,3,5, and9, the max is 9 and the min is 1.
Your program should be able to process a list of any length.
For example, given 1,3,5, and9, the max is 9 and the min is 1.
Your program should be able to process a list of any length.
Lab Finding the max of three numbers
Write a program to decide the max number of the three input number.
Lab Tax Calculation
Study Display 3.1. Based on the income tax rate in Taiwan,
calculate the income tax of a person whose annual income is 1,000,000 or 2,000,000.
calculate the income tax of a person whose annual income is 1,000,000 or 2,000,000.
星期五, 3月 13, 2009
專題演講: 量子力學與天文物理導讀 (禪與生活藝術) 講者: 張耀仁 中原大學電子系
講題: 量子力學與天文物理
講者: 張耀仁,中原大學電子系
課程: 禪與生活藝術,胡寶林院長主持
地點:真知大樓508
時間: 3/18/2009, 5:10-6:40 p.m.
星期一, 3月 09, 2009
Homework 3-9-2009
1. Do Project 4 in Chapter 2
2. Do Project 5 in Chapter 2
3. Do Project 6, in Chapter 2
4. Do Project 7, in Chapter 2
2. Do Project 5 in Chapter 2
3. Do Project 6, in Chapter 2
4. Do Project 7, in Chapter 2
微軟一年一度的實習計畫
Kevin 同學請我轉貼以下訊息:
微軟一年一度的實習計畫招生開跑了
下面是實習的官方網站
http://www.msintern.com/
除了開始招募之外
3/11 18:30在中原大學活動中心音樂廳也有舉辦巡迴講座,
主題是"從微軟的創新及核心價值-看大學生應具備之能力"
微軟一年一度的實習計畫招生開跑了
下面是實習的官方網站
http://www.msintern.com/
除了開始招募之外
3/11 18:30在中原大學活動中心音樂廳也有舉辦巡迴講座,
主題是"從微軟的創新及核心價值-看大學生應具備之能力"
星期二, 3月 03, 2009
網際網路與無線通訊研究大大嘉惠弱勢與身心障礙者生活品質
張耀仁老師實驗室近年來相關研究
Web 2.0網路服務與Ontology技術在非營利租屋網站上之行動研究與效能分析:以崔媽媽租屋網為例 (先進工程期刊: 4卷2期 2009/04) 即將刊登
非營利組織運用Web 2.0社群運算之質化分析與效益評估-以精神障礙者復健與就業輔導工作資訊系統為例(先進工程期刊: 3卷2期 2008/04)
精障者情境感知工作提醒系統(WASN2008)
Web 2.0網路服務與Ontology技術在非營利租屋網站上之行動
非營利組織運用Web 2.0社群運算之質化分析與效益評估-以精神障礙者復健與就業輔導工作資訊系統為例(先進工程期刊: 3卷2期 2008/04)
精障者情境感知工作提醒系統(WASN2008)
新穎的精障者迷走求救與照護派遣系統(WASN2008)
NGO使用網上論壇效益分析: 以精障就業輔導社工為例 (tanet2008)
智慧型精障者路徑導引與預防走失系統之研製 (tanet07) |
無線行動化的社區智慧型空間- 認知障礙者路徑指引系統 (tanet07) |
Web 2.0技術在租屋網站上之實務與研究 -以崔媽媽租屋網為例 (ncs07) |
以行動科學研究法探討Blog 在精神障礙就業輔導的應用(mist2007)
更多
英文版學術著作
張耀仁老師實驗室連續兩年獲選美國無障礙科技獎項
- 學生成果獲選美國ACM ASSEST 2007 無障礙科技競賽前四名
- 由張耀仁老師帶領學生,以研發的實境導航系統,在2007年10月入圍美國無障礙科技研究大賽。此大賽是由微軟公司所贊助的非營利比賽,全球只選出25組,至美國鳳凰城,進行為期三天的科技競賽;由於台灣在過去14年來未有任何作品入圍,因此本次能入圍實屬不易。
星期一, 3月 02, 2009
Homework 3-2-2009
1. Write a program that can reverse the order of an input string. For example, if you input "ab", it will output "ba". If you input "abcdefg", it should return "gfedcba".
2. Write a program that can print names alternatively. The names are in the format of "First Name + Last Name" or "Last Name, First Name". For example, if you input "Walt Savitch", your program will output "Savitch, Walt". If you input "Savitch, Walt", your program will output "Walt Savitch".
Due Mar 9, 2009 at 6:50 p.m.
2. Write a program that can print names alternatively. The names are in the format of "First Name + Last Name" or "Last Name, First Name". For example, if you input "Walt Savitch", your program will output "Savitch, Walt". If you input "Savitch, Walt", your program will output "Walt Savitch".
Due Mar 9, 2009 at 6:50 p.m.
Lab 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.
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 Java casting
Write a Java program as follows:
Let m=1, n=2;
Print m/n
Print m/ (double)n;
Print (double) m/n;
Let m=1, n=2;
Print m/n
Print m/ (double)n;
Print (double) m/n;
Lab Java operators
(a) Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (i++);
Print i;
Ans: 2, 4, 3
(b) Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (++i);
Print i;
Ans: 2, 6, 3
Let i=2;
Print i;
Print 2 * (i++);
Print i;
Ans: 2, 4, 3
(b) Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (++i);
Print i;
Ans: 2, 6, 3
星期一, 2月 23, 2009
Homework 2-23-2009
1. 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.
2. 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.
Hint: There are 5280 feet in a mile.
2. 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.
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 減肥
Do Project 4 on Page 56. (2nd Edition)
Do Project 1 on Page 54. (1st Edition)
artificial sweetener 人工代糖(過量可以致癌)
diet soda pop 減肥可樂
lose weight 減肥
星期一, 2月 16, 2009
Homework 1
1. 兩年前寫了幾篇文章,探討為什麼要學寫程式。參考之後,也描述一下你對寫程式的看法。
2. 參考課本第一章,回答以下問題
a. What is Java Virtual Machine and Java Bytecode?
b. Explain Java's feature "Write once, run anywhere."
Due 2/23/2009 at 18:50
2. 參考課本第一章,回答以下問題
a. What is Java Virtual Machine and Java Bytecode?
b. Explain Java's feature "Write once, run anywhere."
Due 2/23/2009 at 18:50
讓你的部落格產生最新回應
1. 進入版面配置,開啟回應
2. 請你的同學給你一個 comment,是否能正確顯示在最新回應上。
3. 實例
4. 資訊源設定如 http://minstral.blogspot.com/feeds/comments/default
2. 請你的同學給你一個 comment,是否能正確顯示在最新回應上。
3. 實例
4. 資訊源設定如 http://minstral.blogspot.com/feeds/comments/default
Let's start blogging
1. 至 http://www.blogger.com 申請, 請以你的學號 (s開頭) 申請免費帳號。
2. 測試一下,可以寫 "Hello World"
3. 建立一個連結到課程網站 http://javaatcycu.blogspot.com/
建議你使用右上角"自訂"功能,新增一個區塊。一個區塊內可以置放多個連結。
4. 日後請將你的隨堂練習與作業寫在你的 blog, 然後到
Homework 或 Lab 的Comment 登錄作業blog網址就可以了.
請勿將整個作業直接寫在老師部落格的Comment處。
5. 尊重智慧財產權,引用他人文章須註明出處。並且應該合乎學術常規,以合理的方式引用。
How to insert a link at the following comment, please use the following HTML code.
2. 測試一下,可以寫 "Hello World"
3. 建立一個連結到課程網站 http://javaatcycu.blogspot.com/
建議你使用右上角"自訂"功能,新增一個區塊。一個區塊內可以置放多個連結。
4. 日後請將你的隨堂練習與作業寫在你的 blog, 然後到
Homework 或 Lab 的Comment 登錄作業blog網址就可以了.
請勿將整個作業直接寫在老師部落格的Comment處。
5. 尊重智慧財產權,引用他人文章須註明出處。並且應該合乎學術常規,以合理的方式引用。
注意事項
a. blog需正確設定時區顯示時間 。
b. 請測試他人可否留言(comment)。以方便留下回應意見。
How to insert a link at the following comment, please use the following HTML code.
星期日, 2月 15, 2009
訂閱:
文章 (Atom)