20060921 chap1 computer programming fall 2006 李秀惠 [email protected]

19
20060921 chap 1 Computer Programming Fall 2006 李李李 [email protected]

Upload: kathryn-lane

Post on 25-Dec-2015

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1

Computer Programming

Fall 2006李秀惠[email protected]

Page 2: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 2

About this Course Instructor

李秀惠 Email: [email protected] TAs

呂詩禹 Email: [email protected]: 德田館 428, 每週三

AM10:00~PM1:00

林于聖 Email: [email protected] Office: 德田館 428, 每週一 PM1:00~4:00

Time & Places課堂課 : 每週三 5, 6 資 102 實習課 : 每週四 5, 6 計資中心 312

Textbook“Problem Solving and Program Design in C”

Jeri R. Hanly & Elliot B. Koffman, 4th Edition (2004). Addison Wesley. ISBN 0-321-21055-7

RequirementsLabs / Mid-term exam / Final exam

Websitehttp://www.csie.ntu.edu.tw/~c0648060/

Page 3: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 3

Course Outline Introduction Overview of C Top-Down Design with Functions Selection Structures Loop Statements Simple Data Types Arrays Strings Recursion Structure and Union Types Dynamic Data Structures On to C++

Page 4: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1

Chapter 1

Overview of Computers and Programming

Page 5: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 5

Objectives Overview of the development of

computers. Computer system components Software categories and languages Software development steps Process of writing, compiling, and

executing high-level language programs.

An example

Page 6: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 6

Computers IBM ThinkPad ® Sony Clié PDA ® IBM NetVista Desktop

Page 7: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 7

Computer Components Memory:

main secondary

CPU Input devices Output devices

Page 8: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 8

Central Processing Unit (CPU) Coordinating all computer operations Performing arithmetic and logical

operations in data

The processor above can execute a simple instruction such as an integer addition in one six-billionth of a second.

Page 9: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 9

Memory Memory cells Address Contents Main Memory

Random access memory Read-only access memory

Secondary Memory CD, DVD, etc.

Page 10: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 10

Computer Networks (1) Local area network (LAN)

Page 11: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 11

Computer Networks (2) Wide Area Network (WAN)

Page 12: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 12

Computer Software: Operation System (OS) Command-Line Interface

UNIX MS-DOS VMS

Graphical User Interface Macintosh OS Windows OS/2 Warp UNIX + X Window System

Page 13: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 13

Computer Languages Machine Language

Collection of binary numbers Not standardized

Assembly Language Represented by Mnemonic codes Not standardized

High-Level Language Independent of the CPU

Page 14: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 14

High-Level Languages (1)

Language Applications Areas Origin of Name

FORTRAN Scientific programming Formula Translation

COBOL Business data processing Common Business-Oriented Language

LISP Artificial Intelligence List processing

C Systems programming After B

Prolog Artificial Intelligence Logic programming

Ada Real-time distributed systems Ada Augusta Byron

Smalltalk GUI, object-oriented programming

Objects “talk” to one another.

C++ Supports objects and object-oriented programming

Incremental modification of C

Java Support Web programming Originally named “Oak”

Page 15: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 15

High-Level Languages (2)

Page 16: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 16

High-Level Language Program

Page 17: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 17

Flow of Information During Program Execution

Page 18: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 18

Software Development Method1. Specify the problem requirements

2. Analyze the problem

3. Design the algorithm to solve the problem

4. Implement the algorithm

5. Test and verify the completed program

6. Maintain and update the program

Page 19: 20060921 chap1 Computer Programming Fall 2006 李秀惠 hhlee@csie.ntu.edu.tw

20060921 chap1 19

Integrated Development Environment (IDE)