2007年10月27日 星期六

Lab 9*9

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

Lab Fibonacci numbers

Do Project 3.3 (1st ed.) or Project 6 (2nd ed. & 3rd ed.) Fibonacci numbers.List the first 100 numbers and the ratio ofa 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....

2007年10月25日 星期四

Homework 10-12-2007: Finding the max and the min

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.

2007年10月18日 星期四

Bonus: Lab for-loop

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.

2007年10月12日 星期五

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.

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?
由於以前記憶体昂貴,為了節省記憶體,所以縮寫;現在記憶體便宜多了,所以比較不需要;沒縮寫可以讓表達的意思比較清楚;至於縮寫是有節省空間的好處