Vous êtes sur la page 1sur 19

Computer Programming

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++

2
Chapter 1

Overview of Computers and


Programming
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

4
(a) Desktop Computer,
iMac.
(© Hugh Threlfall/Alamy).

(b) Hewlett-Packard
Laptop.
(© Hewlett-Packard Company).

(c) iPad.
(© D. Hurst/Alamy).

d) Android phone, LG
Thrill 4G.
(© Handout/MCT/Newscom).

1-5

© 2012 Pearson Addison-Wesley. All rights reserved. 1-5


Computer Components
 Memory:
 main
 secondary
 CPU
 Input devices
 Output devices

6
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.

7
Memory
 Memory cells
 Address
 Contents
 Main Memory
 Random access memory
 Read-only access memory
 Secondary Memory
 CD, DVD, etc.
8
Relationship Between a Byte and a Bit

1-9

© 2012 Pearson Addison-Wesley. All rights reserved. 1-9


Figure: Secondary Storage Media

1-10

© 2012 Pearson Addison-Wesley. All rights reserved. 1-10


Computer Networks (1)
 Local area network (LAN)

11
Computer Networks (2)
 Wide Area Network (WAN)

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

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

14
High-Level Languages
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 Incremental modification
programming of C
Java Support Web programming Originally named “Oak”

15
High-Level Language Program

16
Flow of Information During
Program Execution

17
Software Development Method
1. 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
18
Integrated Development
Environment (IDE)

19

Vous aimerez peut-être aussi