24
Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Embed Size (px)

Citation preview

Page 1: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Chapter 3 Programming Languages

Unit 1 The Development of Programming Languages

Page 2: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Vocabulary• programmer 程序员• encryption 加密• decryption 解密• number crunching 数字运算• standardized 标准化的• syntax 语法,句法• runtime 运行时间• execute 执行

Page 3: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Vocabulary• compiler 编译器• mechanism 机制• compilation 编译• interpreter 解释• compiled programs 编译程序• interpreted programs 解释程序• source code 源代码• virtual machine 虚拟机

Page 4: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Vocabulary• machine language 机器语言• executable 可执行程序• machine code 机器码• instruction 指令• register 寄存器• binary 二进制的• assembly language 汇编语言• command 命令• assembler 汇编器

Page 5: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Vocabulary• Procedural Programming 面向过程程

序设计• Object-oriented Programming (OOP) 面向对象的程序设计• procedure 过程• variable 变量• procedure call 过程调用

Page 6: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

A primary purpose of programming language is to enable programmers to express their intent for a computation more easily than they could with a lower-level language or machine code.主干?Purpose is to do sth.

to enable sb. to do sth.

Page 7: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

A primary purpose of programming language is to enable programmers to express their intent for a computation more easily than they could with a lower-level language or machine code.What’ the intent?

answer: The intent for a computation

Page 8: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

A primary purpose of programming language is to enable programmers to express their intent for a computation more easily than they could with a lower-level language or machine code.express their intent for a computation more

easilymore easily than … 比…更为容易more easily than they could ( express their intent )with a lower-level language or machine code.比用低级语言或机器代码来表达他们的意图更加容易

Page 9: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

A primary purpose of programming language is to enable programmers to express their intent for a computation more easily than they could with a lower-level language or machine code.译文:程序设计语言的主要目的是使程序员能够表达他们对计算的意图,比使用低级语言和机器代码更为容易。

Page 10: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

What language has been widely used for the development of operating system and compilers?

Answer: C language.

Page 11: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

Programming languages make computer programs less dependent on particular machines or environments.译文:程序设计语言使计算机程序更少依赖于特定的机器或环境。

Page 12: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

Programming languages make computer programs less dependent on particular machines or environments.This is because programming languages are converted into specific machine code for a particular machine rather than being executed directly by the machine.

A be converted into B : A 被转化为 Brather than … : 而不是…

Page 13: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

Answer the following questions according to the last 3 paragraphs in page 72.

1. What are the two mechanisms used to translate a program written in a programming language into the specific machine code of the computer being used?

2. What is the difference between the two mechanisms?

Page 14: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

What are the two mechanisms used to translate a program written in a programming language into the specific machine code of the computer being used?Answer: Compilation and interpreter.

Page 15: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Introduction to the History of Programming Languages

What is the difference between the two mechanisms?Answer: Under the compilation mechanism, the program text is translated as a whole and then the internal format is run. Under the interpreter mechanism, program code is translated at runtime, with each translated step being executed immediately.

Page 16: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Machine Language

What’s machine language?Answer: An executable program is a sequence of extremely simple instructions known as machine code written in machine language. These instructions are specific to the individual computer’s CPU and associated hardware. Machine code instructions are binary——that is, sequences of bits ( 0 s and 1 s ) .

Page 17: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Machine Language1. Executable programs can be run by a

computer’s OS. True or False2.The word “executable” in 1st sentence is

not correspondent with the phrase “executable program” in 2nd sentence. True or False

3. All computers’ processors can use the same sets of machine code. True or False

4. There are a great number of instructions written in machine language. True or False

5. The numbers of machine code instructions each CPU recognizes are of the same. True or False

Page 18: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Machine Language6. Where do machine code instructions

execute? A. bus B. hard disk C. memory D.

register 7. Express the meaning of machine code

in English with a simple sentence.

8. Programmers usually use machine language to write programs. True or False

Machine code is binary sequences of bits (0s and 1s).

Page 19: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Text: Assembly Language What’s the difference between machine language and assembly language?Answer: The instructions written in machine language is sequences consist of 0 s and 1 s and difficult for human to understand. Assembly language is easier for programmers to understand than machine language. Each machine language instruction has an equivalent command in assembly language.

Page 20: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Assembly Language1. Machine language is easier for

human to understand than assembly language. True or False

2. It is possible to find an assembly instruction that can replace certain machine language instruction. True or False

3. Which category of instructions does the statement “MOV A,B” belong to?

A. machine code instruction B. assembly instruction C. high-level language instruction

Page 21: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Assembly Language4. What does the statement “MOV A,B” do

according to the paragraph?5. What’s the name of the program responsible for

translating assembly code into machine code?6. Executing assembly code can be fast because

assembly language is very close to machine language. True or False

7. To execute a high-level program can be faster than to execute an assembly program that carry out the same task as the former’s. True or False

Page 22: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

High-level Language

1. The program written in high-level language is relevant to the computer hardware environment it executes in. True or False

2. High-level programming languages are designed to process specific application. True or False

Page 23: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Procedural Programming

Procedural programming involves creating computer memory locations that can hold values and writing a series of steps or operations that manipulate those values.

The individual operations used in a computer program are often grouped into logical units called procedures.

C Language

Page 24: Chapter 3 Programming Languages Unit 1 The Development of Programming Languages

Object-oriented programming

• Thinking in an object-oriented manner involves envisioning program components as objects that are similar to concrete objects in the real world.

• C++