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月 16, 2009
星期五, 11月 21, 2008
星期五, 10月 31, 2008
星期五, 10月 24, 2008
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
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
參觀老師的新蘇格蘭遊記
星期五, 10月 03, 2008
Homework 10-3-2008
1. Complete Lab Keyboad processing
2. Complete Lab: Numerical Method
3. Do Project 4 in Chapter 2
4. Do Project 5 in Chapter 2
5. Do Project 6, in Chapter 2
6. Do Project 7, in Chapter 2
7. 完成 Lab: 增加回應功能
Due 10/24/2008 13:00
星期五, 9月 26, 2008
Homework 9-26-2008
1. Complete Lab String Processing.
2. 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 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".
星期五, 9月 19, 2008
Homework 9-19-2008
Due 9/26/2008 at 13:00
"tell me and I'll forget; show me and I may remember; involve me and I'll understand"
1. Explain bytecode, JVM
2. Explain class, object
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
"tell me and I'll forget; show me and I may remember; involve me and I'll understand"
1. Explain bytecode, JVM
2. Explain class, object
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
星期一, 6月 09, 2008
星期二, 6月 03, 2008
星期一, 5月 19, 2008
Homework 5-19-2008
1. Do Temperature Project, which is Project 7 (3rd, 2nd ed.) or Project 3 (1st ed.).
星期一, 4月 07, 2008
Average income by gender
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.
Without any change made to your program, your program should be able to process a new set of data, such as follows:
M 52,000
M 35,000
F 48,000
M 33,000
F 75,000
F 110,000
F 90,000
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.
Without any change made to your program, your program should be able to process a new set of data, such as follows:
M 52,000
M 35,000
F 48,000
M 33,000
F 75,000
F 110,000
F 90,000
M 30,100
星期一, 3月 24, 2008
Homework 3-24-2008
1. 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.
2. 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.
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.
2. 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.
星期一, 3月 17, 2008
星期一, 3月 10, 2008
Homework 3-10-2008: 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.
星期一, 3月 03, 2008
Homework 3-3-2008
Due 3/10/2008 at 18:50
"tell me and I'll forget; show me and I may remember; involve me and I'll understand"
1. Explain bytecode, JVM
2. Explain class, object
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
"tell me and I'll forget; show me and I may remember; involve me and I'll understand"
1. Explain bytecode, JVM
2. Explain class, object
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
星期一, 2月 25, 2008
Homework 2-25-2008
Due 3/3/2008 at 18:50
1. Watch The Inside Story (Video), write your words on the development and inventor of Java.
2. List at least 5 applications of Java. You must provide the references you used. We recommend Google Search engine.
ps.
星期六, 12月 29, 2007
期末報告題目
到圖書館挑選三本Java課本,寫下這些書名與作者出版社與出版日期,每本書各挑選一個習題進行個人研究,說明以下
- 你為什麼挑選這個習題(只有題目,沒有範例或解答),
- 這個習題讓你學到什麼概念,
- 請你製作一個講義說明這個習題。
Due: 1/11/2008 at 18:00
星期五, 12月 21, 2007
Homework 12/21/2007
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. You should use constructors to initialize the two vectors.
Hint: The inner product is not a vector. It is a number (scalar).
Sample answer
Hint: The inner product is not a vector. It is a number (scalar).
Sample answer
星期五, 12月 07, 2007
Homework 12-7-2007
1. Define a Complex class and write an object oriented program to compute (2+3i)+(4+5i) in Java.
2. Show comments on your blog.
2. Show comments on your blog.
星期五, 11月 30, 2007
Homework 11-30-2007
1. Do Temperature Project, which is Project 7 (3rd, 2nd ed.) or Project 3 (1st ed.).
2. Do Lab Counter.
2. Do Lab Counter.
訂閱:
文章 (Atom)