Study Display 4.2 & Display 4.4 (2nd 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?
星期一, 3月 27, 2006
星期一, 3月 20, 2006
Lab Finding max from a list of numbers
Write a program that reads 10 numbers from the console.
Pick the largest bumber from the list.
Pick the largest bumber from the list.
Lab Exponential Funtion
Do Project 7 of Chap. 3. (2nd ed.) or Project 4 (1st ed.)
Hint: This lab gets you familiarized with nested for loops.
Hint: This lab gets you familiarized with nested for loops.
Homework 3-20-2006 Lab Fibonacci Numbers
Do Project 3.3 Fibonacci numbers.
List the first 100 numbers and the ratio of
a number to its previous number.
Want to know more about Fibonacci number
List the first 100 numbers and the ratio of
a number to its previous number.
Want to know more about Fibonacci number
星期一, 3月 13, 2006
星期一, 3月 06, 2006
Lab 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.
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.
calculate the income tax of a person whose annual income is 1,000,000.
Lab Scanner
Do Display 2.6 on Page 79.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
Change
Scanner keyboard= new Scanner(System.in);
into
BufferedReader keyboard= new BufferedReader(new InputStreamReader(System.in));
String inputString = keyboard.readLine();
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
Change
Scanner keyboard= new Scanner(System.in);
into
BufferedReader keyboard= new BufferedReader(new InputStreamReader(System.in));
String inputString = keyboard.readLine();
訂閱:
文章 (Atom)