Chapter 1 Introduction puters, Programs, and C++
§ and Program
§ Programming
§ Introduction to C++
Computer Is Everywhere
2
Computer:
-- machine to manipulate data according to instructions.
Components puters
3
Memory(内存)
4
Memory is to store data and program instructions for CPU to execute.
A program and its data must be brought to memory before they can be executed.
A memory unit is an ordered sequence of bytes, each holds eight bits.
Memory is volatile
Data is lost when the power is off
How Data Stored?
Data: numbers, characters, and strings…
Computers use “0” and “1” to represent all data
Encoding and decoding
Data binary code
automatically done by puter
The encoding scheme varies.
A byte (字节), of 8 bits (位), is the minimum storage unit
5
Number Systems (数制)
binary
6
0, 1
0, 1, 2, 3, 4, 5, 6, 7
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
octal
decimal
hexdecimal
Computer Program (计算机程序)
Computer programs
Known as software, are instructions to puter.
You tell puter what to do through programs.
Programs are written using programming languages.
7
Catch the ball!
Come back!
§ Programming (编程)
The process of writing, testing, debugging, and maintaining the source code puter programs
Programming Procedure
Problem-solving phase
Problem analysis and specification
General solution (algorithm)
Verification
Implementation phase
Concrete solution (program)
Debugging and test
8
Program vs. Algorithm (算法)
Program:
A sequence of instructions written to perform a specified task with puter
Algorithm:
an effective method expressed as a finite list of well-defined instructions for calculating a function
9
Step 1: ….
Step 2: ….
…
An Example Algorithm
Problem:
The mon divisor/factor of two integers
Euclid’s algorithm: (1599,650)
10
【精品】PPT课件 Chapter 1 Introduction puters, Programs, and C++ 来自淘豆网www.taodocs.com转载请标明出处.