2008年10月31日 星期五

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 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

2008年10月24日 星期五

Lab Finding the max of a list of numbers

Lab Finding the max of three numbers



Lab: Tax Calculation

Homework 10-3-2008

1. Complete Lab Keyboad processing
2. Complete Lab: Numerical Method
3.Project 4 in Chapter 2


4.Project 5 in Chapter 2

5.Project 6, in Chapter 2

6.Project 7, in Chapter 2


Lab: Numerical Method



Project 1 of Chap. 2.


2008年10月3日 星期五

chap2-3





Lab Keyboard Input

Lab Scanner

反轉

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".

String Processing

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.