Course: Introduction to Computer Science

Course(課程)

Title: Introduction to Computer Science
Number: 4101005
Time: Monday 14:10-15:00 and Thursday 14:10-16:00
Place: 教學大樓 206

Instructor(教師)

陳裕賢 (Yuh-Shyan Chen)
Office: EA506
Phone: 33115
Email: yschen@cs.ccu.edu.tw

Description (目標)

This course introduces the basic concepts of computers and computer science. This course also introduces the basic skills of programming in the programming language C and basic techniques for solving problems using computers. This course will use Microsoft Visual C++ or Borland C++ as the programming environment.

Teaching Assistants (助教)

Number: 4101009

Group A: 張原豪 (資工所博一)
Office: EA314
Phone: 23129
Email: cyh@cs.ccu.edu.tw

Grade: Score-List for Group A

Group B: 張雅芬 (資工所博二)
Office: EA401
Phone: 23134
Email:  cyf@cs.ccu.edu.tw

Grade:  Score-List for Group B
 

Group C: 周永振 (資工所博一)
Office: EA401
Phone: 23134
Email: jackjow@cs.ccu.edu.tw

Grade: Score-List for Group C

Group D: 呂慈純 (資工所博二)
Office: EA401
Phone: 23134
Email: ltc@cs.ccu.edu.tw

Grade: Score-List for Group D
 

Group E: 楊允軒 (資工所碩一)
Office: EA301B
Phone: 23123
Email:  fury@single.url.com.tw

Grade: Score-List for Group E
 

Group F: 張瀚謙 (資工所碩一)
Office: EA301B
Phone: 23123
Email: lken_tw@yahoo.com.tw

Grade: Score-List for Group F
 

Group G: 安心怡 (資工所碩一)
Office: EA301B
Phone: 23123
Email: javanew1@yahoo.com.tw
Grade: Score-List for Group G
 
Group H: 劉耿紹 (資工所碩一)
Office: EA301B
Phone: 23123
Email: hellocation@yahoo.com.tw
Grade: Score-List for Group H
 

Textbook (教科書)

C How to Program (Introducing C++ and Java)

Authors:   DEITEL & DEITEL

Book Agency: 全華書局

Exams (考試)

項目符號 Midterm Solutions
項目符號 Final Solutions
項目符號 Grading Criteria for Final Exam
項目符號 Final Grade
項目符號 Final Grade for Lab Session

Lecture Notes (講義)

Part I: C Language

Chapter 1: Introduction to Computers, the Internet and the WWW

Chapter 2: Introduction to C Programming

Chapter 3: Structured Program Development in C

Chapter 4: C Program Control

Chapter 5: C Functions

Chapter 6: C Arrays

Chapter 7: C Pointers

Chapter 8: C Characters and Strings

Chapter 9: C Formatted Input/Output

Chapter 10: C Structures, Unions, Bit Manipulations and Enumerations

計算機實習

項目符號

Week 1:  請熟悉 Window 98 or Window 2000 (助教自行說明) and Visual C++ 的編譯環境. 請助教分好組別 週一(A,B組), 週二(C,D組), 週三(E,F組), 週四(G,H組), 助教將名單給我.

項目符號

Week 2: 請熟悉 Notepad, Outlook and Visual C++ Debugger. (助教自行說明)

項目符號

Week 3:  撰寫你(妳)的第一次C程式s, (自行準備磁碟片備份資料), Chapter 2 習題 2.20, 2.21, 2.23, and 2.25. 請助教控制時間, 原則只在上課時間練習, 做不完回去再做, 每一個 program 要根據 Program Comment Format (程式註解格式) 加入 comments.  

項目符號

Week 4:  撰寫你(妳)的第二次C程式, 習題 3.47(a) [以作 3.47(a)為原則, 3.47(b) 和 3.47(c) 為加分題] [逢放假日的班級, 習題回去做, 下一週再請助教登記一下成績]

項目符號

Week 5: 分別以 while 和 for 迴圈指令寫出 習題 4.31.

項目符號

Week 6: (a) 以 do/while 指令 重寫出 習題 4.31, and (b) 習題 4.30, [goal: You may use if/else instruction to rewrite the switch multi-selection instruction in the C program]

項目符號

Week 7: 習題 5.16: 練習寫出一個 function.

項目符號

Week 8: 習題 5.37: 練習寫出一個 recursive function.

項目符號

Week 9: [從11/18 週一開始] (1) 利用 #define SIZE preprocessor directive 定義一個一維陣列, (2) 利用亂數產生一維陣列的內容, (3) 利用 Passing Array to Functions 寫出一個 sorting function.

項目符號

Week 10: 以 pointer 改寫前一週的 bubble sorting function 習題.

項目符號

Week 11: 加入 Section 7.11 Pointers to Functions 的功能, (參考 Fig. 7.26 範例), 修改前兩週的習題, 變成可 ascending 或 descending 只要在 bubble sorting function 中加入 bubble (a, SIZE, ascending)bubble (a, SIZE, descending), 注意 ascending 和 descending 是兩個不同獨立的functions.

項目符號

Week 12: Write a recursive function to list all possible permutations of a given character list (string).

    For example, consider an input character sequence (string) is “abcd”, then your recursive program MUST print all permutations of string “abcd”:

“abcd”, “abdc”, “acbd”, “acdb”, “adbc”, “adcb”,

“bacd”, “badc”, “bcad”, “bcda”, “bdac”, “bdca”,

“cabd”, “cadb”, “cbad”, “cbda”, “cdab”, “cdba”,

“dabc”, “dacb”, “dbac”, “dbca”, “dcab”, “dcba”.

Note that your recursive program must be produced all permutations for any-size character sequence.

 

項目符號

Week 13:

Write your own str_cpy,  strn_cpy, str_cat, and str_ncat functions as follows.

 

char *str_cpy (char *s1, const char *s2)
/*     Copies string s2 into s1. The value of s1 is returned.  */

 

char *strn_cpy (char *s1, const char *s2, size_t n)
/*     Copies at most n characters of string s2 into s1. The value of s1 is returned. */

 

char *str_cat (char *s1, const char *s2)
/*     Appends string s2 to array s1. The first character of s2 overwrites the terminating null character  

       of  s1. The value of s1 is returned. */

 

char *str_ncat (char *s1, const char *s2, size_t n)
/*     Appends at most n characters of string s2 to array s1. The first character of s2 overwrites the

       terminating null character of s1. The value of s1 is returned. */

 

項目符號

Week 14: Try to write your own str_ok, mem_cpy, and str_len functions.

      char *str_tok (char *s1, const char *s2)
       /*     A sequence of calls to strtok breaks string s1 into “tokens” – logical pieces such as

              words in a line of text – separated by characters contained in string s2.  */

 

     void *mem_cpy (void *s1, const void *s2, size_t n);
     /*    Copies n characters from the object pointed to by s2 into object pointer to by s1.

           A pointer to the resulting object is returned.  */

     size_t *str_len ( const char *s)

     /*   Determines the length of string s. The number of characters preceeding the terminating

           null character is returned. */

 

項目符號

Week 15: Try to write a recursive function to reverse a string (call by reference).

    For example, char a[] = "ABCDEFGH" ;

                        printf (" %s \n", a); /* "ABCDEFGH" */

                        reverse_string (a);

                        printf (" %s \n", a); /* "HGFEDCBA" */

項目符號

Week 16: 根據 page 387 (Section 10.7, Example:  High-Performance Card Shuffling and Dealing Simulation), 仿寫出本學期的最後一個習題.  [練習目的: struct 的用法]: 同樣的題目, 自由撰寫.

學期成績計算方法:

(1) 期中考: (30%)

(2) 實習成績: (30%)

(3) 期末考:  (40%) 方式、地點與期中考一樣, 時間: 1/15,  4:10 ~ 5:30 (pm).

 

Assignment:

項目符號 Program Comment Format (程式註解格式)