程式語言 (Principles of Programming
Languages)
2011
教師: 江振瑞 (jrjiang_a_t_csie.ncu.edu.tw)
助教: 黃捷群 吳玠儀 秦承鴻 楊家俊 周定緯 林子浩
繳交作業:Blackborad System: http://bb.ncu.edu.tw (程式語言A)
上課時間:Tuesday 15:00~17:50
上課地點:E6-A204
教科書下載:
軟體下載:
相關聯結:
評分方式 (Tentative):
- First Exam: 40%
- Extra Test: 10%
- Term Project: 35% (An Android App on Android Market)
- In-Class Status, Quiz and Homework: 25%
授課大綱:
In this course, we will teach
the following materials:
- Java Language Fundamentals
- Java Networking Programming (option)
- Android Application Programming (News: http://udn.com/NEWS/FINANCE/FIN3/6165586.shtml)
- International Collegiate
Programming Contest (option)
2/22: Course Introduction (AndroidExamples.rar)
Homework 1: 設計一個Java應用程式,印出 Hello, World! I am James Smith
(your name). The homework should include your source code and the
result screenshot(s) and be handed in via BB before next TA's class.
3/1:
3/8:
- My book's chapters 4 and 5 (Java04.ppt) (Java05.ppt)
- Liang's book chapter 6 for actual parameters, formal parameters
and Sudoku
- Homework 4: Liang's Book Exercise 3.19 (Checking ISBN) on page
129.
Due: before next TA's class.
- (LiangBookSlides)(LiangBookPages)
- Homework 5: Liang's Book
Exercise 6.35 (Eight Queens) on page 256. (Bonus).
- Homework 6: Liang's Book
Exercise 6.36 (Sudoku) on page 256 (Bonus).
3/15:
- My book's chapters 6 and 7 (Java06.ppt)
(Java07.ppt)
- My book's appendix: Java1.5新特性 (JavaE.ppt)
- Liang's book chapter 5 for Math class
- Homework 7: Write a Java application to deal pokers. Your ouput
should be as follows.
Due: before next TA's class.
1: S1 S3 SJ SQ H2 H6 HK D5 D9 DT C1 C5 CT
2: ....
3: ....
4: ....
- Homework 8: Write a Java method with one an integer formal
parameter n to return the largest 'perfect number' no larger than n. 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. (Bonus)
- Homework 9: Write a Java
program to oupute a forged ISBN-10 number.
- Homework 10: Write a Java
program to output a forged credit card number. Note that your should
allow users to select the card issuer (e.g., VISA: 4, Master: 5, and so
on). You can refer to Liang's book on page 204-205 (Bonus). (LiangBookPages-2)
- Homework 11: Liang's Book
Exercise 5.28 (Mersenne Prime) on page 203 (Bonus).
3/22
- My book's chapter 2: Java Applet (Java02.ppt)
- My book's chapter 8: Multimedia (pdf)(ppt)
- You should choose either
Homework 12(a) or 12(b). If you choose both, there will be a bonus.
- Homework 12(a): Write a Java
Applet to use
JOptionPane.showInputDialog
method to input two intergers n and m, both less than 2147483648,
for calculating their greatest common divisor (gcd) by the Euclidean
algorithm, and use JOptionPane.showMessageDialog method to show the
gcd. Due: before next TA's class.
- Homework 12(b): Write a Java Applet to draw circles,
ovals, lines, diamonds, triangles, squares, pentagons, and
hexagons, etc., with random colors and sizes on the 500 pixels by 500
pixels Graphics area. Due:
before next TA's class.
3/29:
- My book's chapter 9: GUIs (pdf) (ppt)
- My book's chapter 10: Events (pdf) (ppt)
- You should choose either
Homework 13(a) or 13(b). If you choose both, there will be a bonus.
- Homework 13(a): Write a Java
Applet to use
two TextField components to input two intergers n and m, both less than
2147483648,
for calculating their greatest common divisor (gcd) by the Euclidean
algorithm. When presssing the button componet, the gcd of the two
integers will show in a label componet. Due: before next TA's class.
- Homework 13(b): Write a Java
Applet to
embed an animation of a Web page showing shrinking/growing geometric
shapes,
such as circles, lines, diamonds, triangles, squares, pentagons, and
hexagons, with random colors. (Due: before next TA's class)
- Homework 14: Write a Java
Applet, a
Frame or a JFrame to simulate a calculator. (Bonus) Due: before 4/22
(Note that all bonus homework assigned before Midterm Exam. should be
handed before 4.22.)
4/12:
4/19:
- Midterm (Scope: All
materials in my book and some in Dr. Liang's book)
4/26: Android History and Installation
- Homework 15: Write an
Android App (Application) to show the following message on your virtual
device screen.
This is my first Android App
Hello, 學生姓名與座號
You should capture the screenshoot of your virtual device and hand in a
hardcopy of your homework before next week's class.
5/3: Android Key Concepts and User
Interfaces (
Ch2.ppt)
(
Ch3.ppt)
- Homework 16: Write an
Android App (Application) to show a user initerface with one textview
(value="Homework 16") and four buttons (values="學號" "學
生姓名第1字" "學
生姓名第2字" "學
生姓名第3字".
- You should capture the
screenshoot of your virtual device and upload your homework before next
week's class.
5/10: User Interfaces (
Ch3.ppt)
- Homework 17: Write an
Android App (Application) to show a user initerface with a menu of
settings, one textview
(value="Homework 17") and four buttons (values="學號" "學
生姓名第1字" "學
生姓名第2字" "學
生姓名第3字" such
that each button has an associated activity of theme.
5/17: Using socket in Android
5/24: 2D Graphics (
Ch4.ppt)
- Homework
19:
Write an Android App to output a 9 x 9 magic square. (Bonus)
5/31: Multimedia (Ch5.ppt)
and Storing Local Data (Ch6.ppt) (Ch5-6Note.docx)
6/7: The Connected World (Ch7.ppt) and Locating and Sensing (Ch8.ppt)
(Ch7-8Note.docx)
6/7: Our own example of Android Application: FollowMe (FollowMe.ppt) (FollowMe.rar)
6/14:
Project Proposal Oral Report.
(5%-10% out of the term project 35%
score) You should upload your one or two slides by noon on June 13 so
that TAs can stall them beforehand. You have three minutes to show your
app's theme, rules, prototype screenshots, etc. Consider the
feasibility of your app and make it available before 6/27. However,
don't copy others' apps; otherwise, you and the one being copied will
get a 0 score. Add some innovations into your app and don't make your
app too trivial or boring; otherwise, you'll get a very low score.
6/20-27: Make an appointment with
TAs to demenstrate your app in apk
form or in Android Market form. You should at least upload your app
into designated space in advance and provide a QR code for your app
(optinal). I will finalize the scores on 6/28.
教科書及參考書:
- 中文Java程式設計,
江振瑞 著, 儒林出版社
- Ed Burnette, "Hello,
Android: Introducing Goole's Mobile Development Platform" 楊仁和 翻譯, ��峯出版
- Steven S. Skiena and Miguel
Revilla, "Programming Challenges," Elsevier, 2003.
- 物件導向資料結構
— 使用Java語言, 江振瑞 著, 松崗圖書公司
- 網路應用程式開發 — 使用Google App Engine, 李威和 編著
- Y. Daniel Liang, "Introduction to Java Programming," 7th Edition,
Pearson Education International, 2009.
- H. Zhang and Y. Dniel Liang, "Computer Graphcis using Java 2D and
3D," Pearson Education International, 2007.
- Deitel and Deitel, "Java How to Program," 7/e, Pearson Education,
2008.
- Robert W. Sebesta, "Concepts of Programming Languages," 7/e,
Pearson Education International, 2005.
- Java2程式設計入門與應用, 吳權威、王曉慧 編著, 網奕資訊 出版
- 精彩Java2程式設計, 吳逸賢、吳目誠 編著, 網奕資訊 出版
- 精彩JavaScript程式設計, 吳逸賢、王曉慧 編著, 網奕資訊 出版
- Java網際網路程式設計, 黃嘉輝 著, 文魁出版社
- JSP動態網頁入門實務, 位元文化 編著, 文魁出版社
- Java網路程式設計, 顏春煌 編著, 旗標出版社
相關鏈結: