µ{¦¡»y¨¥ (Principles of Programming
Languages)
2011
±Ð®v¡G ¦¿®¶·ç (jrjiang_a_t_csie.ncu.edu.tw)
§U±Ð¡G ¶À±¶¸s §dÍk»ö ¯³©ÓÂE ·¨®a«T ©P©w½n ªL¤l¯E
ú¥æ§@·~¡GBlackborad System: http://bb.ncu.edu.tw (µ{¦¡»y¨¥A)
¤W½Ò®É¶¡¡GTuesday 15:00~17:50
¤W½Ò¦aÂI¡GE6-A204
±Ð¬ì®Ñ¤U¸ü¡G
³nÅé¤U¸ü:
¬ÛÃöÁpµ²:
µû¤À¤è¦¡ (Tentative)¡G
- First Exam: 40%
- Extra Test: 10%
- Term Project: 35% (An Android App on Android Market)
- In-Class Status, Quiz and Homework: 25%
±Â½Ò¤jºõ:
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: ³]p¤@ÓJavaÀ³¥Îµ{¦¡¡A¦L¥X 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:
- ¼¶¼g²Ä¤@ÓJavaµ{¦¡ (Application)
(pdf)(Java01.ppt)
(JDK
online document)
FirstApplication.java(ªì¾ÇªÌ¼¶¼gªº²Ä¤@Ó
Javaµ{¦¡)
²Ä¤@ÓÀ³¥Îµ{¦¡.
java(ªì¾ÇªÌ¼¶¼gªº²Ä¤@Ó¥þ¤¤¤åJavaÀ³¥Îµ{¦¡)
- «Ø¥ßµ{¦¡°õ¦æÀô¹Ò (Install JDK)(JavaB.ppt)(Install MinGW)(JavaF.ppt)(Install Jeep4)(JavaC.ppt)
- ÅܼƻP¹Bºâ¤l (Java03.ppt)
- Homework2:
³]p¤@ÓJavaÀ³¥Îµ{¦¡¡A¨Ï¥ÎJOptionPane.showInputDialog¤èªk¿é¤J¤@Ó¿ºë·Ç«×¯BÂI¼Æ¡Apºâ¦¹¼Æ¤§¥¤è®Ú¤Î¥ß¤è®Ú¤§È¨Ã¨Ï
¥Î JOptionPane.showMessageDialog¤èªk±Nµ²ªG¦L¥X(Problems 3-10)¡C(Your report
should
contain the program and result screenshots and be handed in before TA's
class.)
- Homework3 : Write a Java program to input an integer n, n>=2,
and output every prime p, 2<=p<=n. Your report should contain the
program and result screenshots and be handed in before TA's class.)
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·s¯S©Ê (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, ¾Ç¥Í©m¦W»P®y¸¹
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="¾Ç¸¹" "¾Ç
¥Í©m¦W²Ä1¦r" "¾Ç
¥Í©m¦W²Ä2¦r" "¾Ç
¥Í©m¦W²Ä3¦r".
- 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="¾Ç¸¹" "¾Ç
¥Í©m¦W²Ä1¦r" "¾Ç
¥Í©m¦W²Ä2¦r" "¾Ç
¥Í©m¦W²Ä3¦r" 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µ{¦¡³]p,
¦¿®¶·ç µÛ, ¾§ªL¥Xª©ªÀ
- Ed Burnette, "Hello,
Android: Introducing Goole's Mobile Development Platform" ·¨¤¯©M ½Ķ, ùÖ峯¥Xª©
- Steven S. Skiena and Miguel
Revilla, "Programming Challenges," Elsevier, 2003.
- ª«¥ó¾É¦V¸ê®Æµ²ºc
¡X ¨Ï¥ÎJava»y¨¥, ¦¿®¶·ç µÛ, ªQ±^¹Ï®Ñ¤½¥q
- ºô¸ôÀ³¥Îµ{¦¡¶}µo ¡X ¨Ï¥ÎGoogle App Engine, §õ«Â©M ½sµÛ
- 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µ{¦¡³]p¤Jªù»PÀ³¥Î, §dÅv«Â¡B¤ý¾å¼z ½sµÛ, ºô«³¸ê°T ¥Xª©
- ºë±mJava2µ{¦¡³]p, §d¶h½å¡B§d¥Ø¸Û ½sµÛ, ºô«³¸ê°T ¥Xª©
- ºë±mJavaScriptµ{¦¡³]p, §d¶h½å¡B¤ý¾å¼z ½sµÛ, ºô«³¸ê°T ¥Xª©
- Javaºô»Úºô¸ôµ{¦¡³]p, ¶À¹Å½÷ µÛ, ¤å»í¥Xª©ªÀ
- JSP°ÊºAºô¶¤Jªù¹ê°È, ¦ì¤¸¤å¤Æ ½sµÛ, ¤å»í¥Xª©ªÀ
- Javaºô¸ôµ{¦¡³]p, ÃC¬K·× ½sµÛ, ºX¼Ð¥Xª©ªÀ
¬ÛÃöÃìµ²: