2007年10月27日 星期六
Lab Fibonacci numbers
2007年10月25日 星期四
Homework 10-12-2007: Finding the max and the min
2007年10月18日 星期四
Bonus: Lab for-loop
2007年10月12日 星期五
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.
2007年10月11日 星期四
Quiz 10-12-2007
1. Let i, j be two integers. Write a program to exchange their values. How can you show your program is correct.
2. The identifier BufferedReader is normally abbreviated as BR in programming language C. However, Java programmers normally do not use abbreviations for identifiers. What are the advantages and disadvantages of not using abbreviations?
由於以前記憶体昂貴,為了節省記憶體,所以縮寫;現在記憶體便宜多了,所以比較不需要;沒縮寫可以讓表達的意思比較清楚;至於縮寫是有節省空間的好處
2. The identifier BufferedReader is normally abbreviated as BR in programming language C. However, Java programmers normally do not use abbreviations for identifiers. What are the advantages and disadvantages of not using abbreviations?
由於以前記憶体昂貴,為了節省記憶體,所以縮寫;現在記憶體便宜多了,所以比較不需要;沒縮寫可以讓表達的意思比較清楚;至於縮寫是有節省空間的好處
2007年10月5日 星期五
2007年9月28日 星期五
2007年9月27日 星期四
Homework 9/21/2007
1. Explain bytecode, JVM
bytecode
The Java compiler translates your Java program into a language called bytecode,which isthe machine language for a fictitious computer.It is easy to translate this bytecode into the machine language of any particular computer.Each type of computer will have its own interpreter that translates and executes bytecode instructions.
JVM
The Java Virtual Machine is very similar to all typical computers.Thus,it iseasy to translate a program written in bytecode into a program in the machine laguage for any particular computer.
2.Explain class, object
Class
物件導向設計中,物件並不是憑空產生的,你必須先定義你的物件,你要ㄧ個規格書,這個規格書稱之為類別(Class)
Object
object(物件):將一組彼此相關的「程序」(Procedure)和「資料」(Data),由軟體程式碼將他們封裝起來這些程序為物件之「方法」(Method);資料則為「成員變數」(Field)「物件」是「類別的實例(an instace of a 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;
4.2 Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (++i);
Print i;
4.3 Write a Java program as follows:
Let m=7, n=2;
Print (double) m/n;
Print m/ (double)n;
bytecode
The Java compiler translates your Java program into a language called bytecode,which isthe machine language for a fictitious computer.It is easy to translate this bytecode into the machine language of any particular computer.Each type of computer will have its own interpreter that translates and executes bytecode instructions.
JVM
The Java Virtual Machine is very similar to all typical computers.Thus,it iseasy to translate a program written in bytecode into a program in the machine laguage for any particular computer.
2.Explain class, object
Class
物件導向設計中,物件並不是憑空產生的,你必須先定義你的物件,你要ㄧ個規格書,這個規格書稱之為類別(Class)
Object
object(物件):將一組彼此相關的「程序」(Procedure)和「資料」(Data),由軟體程式碼將他們封裝起來這些程序為物件之「方法」(Method);資料則為「成員變數」(Field)「物件」是「類別的實例(an instace of a 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;
4.2 Write a Java program as follows:
Let i=2;
Print i;
Print 2 * (++i);
Print i;
4.3 Write a Java program as follows:
Let m=7, n=2;
Print (double) m/n;
Print m/ (double)n;
訂閱:
文章 (Atom)