計算機語言與程式設計 2006
教師信箱:jrjiang@csie.ncu.edu.tw
(江振瑞)
作業繳交:p95da004@mail.nhcue.edu.tw
上課時間:星期二 9:10~12:00
上課地點:9304電腦教室
軟體下載:
相關聯結:
授課大綱:
- 撰寫第一個Java程式 (Application) (Java01.ppt)
- 建立程式執行環境 (Install
JDK)(JDK
5.0 online document)(Install
MinGW)(Install
Jeep3)
Homework1: Install JDK, MinGW, Jeep3 and write
a "Hello World!" program in Java. You should put the screenshot in a MS
Word file before handing in. Due: Sept. 26
- History of Programming Languages (JavaA.ppt)
- 變數的型別及運算子的使用 (Java03.ppt)
Homework2: Write a Java application to input a positive integer n larger
than 2 and no larger than 2147483647, and to output the largest prime
less than n. The homework should include the programs and the output results.
Due: Oct. 3
- 陣列與迴圈的使用 (Java04.ppt)
Homework3: Write a Java application to draw cards
1000 times and to list the total number of occurrences for each card.
(You should use S, H, D, and C to stand for different patters.) The homework
should be in MS-Word format to include the program and the output results.
You must mail your homework to p95da004@mail.nhcue.edu.tw
with subject Homework3-ID##### by Oct.
16 Midnight.
- 流程控制敘述 (Java05.ppt)
Homework4: Write a Java application to input
an integer and test whether it is a 'perfect number'. A perfect
number is defined as an integer which is the sum of its proper positive
divisors, that is, the sum of the positive divisors not including the
number. The first perfect number is 6, because 1, 2 and 3 are its proper
positive divisors and 1 + 2 + 3 = 6. The next perfect number is 28 = 1
+ 2 + 4 + 7 + 14. You must mail your homework
to p95da004@mail.nhcue.edu.tw
with subject Homework4-ID##### by Oct.
23 Midnight.
Quiz-10-24-2006
(with answers)
Homework5: Write a Java application to solve
the problem of "Prime
Word". You can use JOptionPane.showInputDialog and JOptionPane.showMessageDialog
as I/O functions. You must mail your homework
to p95da004@mail.nhcue.edu.tw
with subject Homework5-ID##### by Oct.
30 Midnight.
- 綜合練習
- 列印一個底與高均為66個星號的三角形。
*
**
.....
*****************************************************************
- 輸入一個正整數n,求n除了本身以外的最大因數?例如,輸入100則輸出50。
- 輸入一個正整數n,求大於n的最小質數?例如,輸入97則輸出101。
- 輸入二個正整數m及n,列出所有介於西元m年及n年間的閏年?
- 隨機產生一個介於1~9之間的整數n(每個數字產生的機率都是1/9),使用switch-case敘述,當n為1、2、3時分別列出剪刀、石頭、布;而n為其他數字時,列出未決定。
- 輸入一個正整數n,計算小於等於n的3或5的倍數的正負交錯倒數和(1/3-1/5+1/9-1/10+1/12-...)?
Homework6: 設計一中文金額與10進位數字之轉換程式:
1.可以輸入一個介於0到10^9的10進位數字,傳回其對應的中文金額:
如:
102,壹佰零貳;
3456,參仟肆佰伍拾陸;
78900,柒萬捌仟玖佰
註:零壹貳參肆伍陸柒捌玖;拾佰仟萬億;
2.可以輸入一個中文金額,可以傳回對應的10進位數字
You must mail your homework to p95da004@mail.nhcue.edu.tw
with subject Homework6-ID##### by Nov.
6 Midnight.
In Class Homework: 設計一Java程式,可輸入縣市別代碼及性別代碼,並自動產生一個正確的身分證字號。 身分證字號真偽.java
Nov. 7
- 期中考 (Nov. 14) (MidtermExamPaper)
- 類別與物件 (Java06.ppt)
Car.java P1121.java MyArray.java
P1121_1.java
Homework7: Create an object that takes
an array and its cardinality as data mambers and takes 最大值、亂數設定、顯示陣列
functions as method members. You must mail your
homework to p95da004@mail.nhcue.edu.tw
with subject Homework7-ID##### by Nov.
27 Midnight.
- 在網頁中使用Java小程式 (Applet)(Java02.ppt)
Homework8: Write a Java applet to input an integer
and test whether it is a 'perfect number'. A perfect number is
defined as an integer which is the sum of its proper positive divisors,
that is, the sum of the positive divisors not including the number. The
first perfect number is 6, because 1, 2 and 3 are its proper positive
divisors and 1 + 2 + 3 = 6. The next perfect number is 28 = 1 + 2 + 4
+ 7 + 14. You must mail your homework to p95da004@mail.nhcue.edu.tw
with subject Homework8-ID##### by Dec.
11 Midnight.
- There will be no class on Dec. 5 since I have to chair a
session for ICS'06.
- 配合HTML語言編寫內嵌Java Applet及Java
Script的動態網頁 HTML_Applet.java HTML_Applet.html
Homework9: Design your own homepage with Java Applet
and JavaScript functions. You must mail your
homework to p95da004@mail.nhcue.edu.tw
with subject Homework9-ID##### by Dec. 18
Midnight.
- Java語言中的多媒體
(Java08.ppt)(applet.zip)(LoadImage.html)(LoadAudio.html)(Animation.html)(A2.html)
- Homework10 (Write an applet to generate
a fancy animation and embed the applet in a html file). You must mail your homework to p95da004@mail.nhcue.edu.tw
with subject Homework10-ID##### by Dec. 25
Midnight.
-
- 類別庫 (Java07.ppt)
(String 類別的使用)
- No homework for Dec. 26.
- Oral Report: Jan. 2nd and Jan. 9th.
- Final
Examination (Date: Jan. 15th Time: 3:10AM~6:00AM) (考試範圍為全學期上課的所有內容,題型包括預測結果、程式設計及問答題)
教科書:
參考書:
評分方式:
- Midterm Exam. (25%)
- Final Exam. (40%)
- Final Report (15%)
- In class and homework (20%)