《计算机专业英语》谢希仁第二版-第7章讲义.pptx
《《计算机专业英语》谢希仁第二版-第7章讲义.pptx》由会员分享,可在线阅读,更多相关《《计算机专业英语》谢希仁第二版-第7章讲义.pptx(37页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Key points:useful terms and definitions of programming languagesDifficult points:describing the differences between compilers and interpreters第1页/共37页Requirements:1.The origins of the programming languages2.The concepts of computer compilers3.Main properties of object-orientation4.掌握复杂定语从句的翻译技巧掌握复杂定
2、语从句的翻译技巧 第2页/共37页New Words&Expressions:translator n.翻译器,翻译程序翻译器,翻译程序 syntax n.语法,句法语法,句法machine language 机器语言机器语言assembly language 汇编语言汇编语言abbreviate v.缩短,缩写缩短,缩写compile v.编译编译interpret v.解释解释 7.1 Introduction to Programming LanguageAbbreviations:OOPL(object-oriented programming language)OOPL(object
3、-oriented programming language)面向对面向对象的程序设计语言象的程序设计语言第3页/共37页A programming language represents a special vocabulary and a set of grammatical rules for instructing a computer to perform specific tasks.Broadly speaking,it consists of a set of statements or expressions understandable to both people and
4、 computers.7.1 Introduction to Programming Language程序设计语言是指令计算机实现某些具体任务的一套特殊词汇和一组语法规则。从广义的角度说,它包括一组既能被人所理解又能被计算机所识别的声明和表达式。第4页/共37页People understand these instructions because they use human(English and mathematical)expressions.Computers,on the other hand,process these instructions through use of sp
5、ecial programs,which,known as translators,decode the instructions from people and create machine-language coding.为人们所能理解是因为它们使用的是人类的(英文和数学的)为人们所能理解是因为它们使用的是人类的(英文和数学的)表达方式。另一方面,计算机通过使用专门的程序来处理这表达方式。另一方面,计算机通过使用专门的程序来处理这些指令,这些专门的程序就是我们所熟知的翻译程序,它能些指令,这些专门的程序就是我们所熟知的翻译程序,它能解码我们发出的指令并生成机器语言代码。解码我们发出的指令并
6、生成机器语言代码。7.1 Introduction to Programming Language第5页/共37页The term programming language usually refers to high-level languages,such as BASIC,C,C+,COBOL,FORTRAN,Ada and Pascal.Each language has a unique set of key words(words that it understands)and a special syntax for organizing program instructions
7、.所谓程序设计语言通常是指高级语言,像所谓程序设计语言通常是指高级语言,像BASIC,C,C+,COBOL,FORTRAN,Ada 和和 Pascal。每种语言都具有一套。每种语言都具有一套独特的关键字(它能理解的字)和组织程序指令的专门语法。独特的关键字(它能理解的字)和组织程序指令的专门语法。7.1 Introduction to Programming Language第6页/共37页High-level programming languages,while simple compared to human languages,are more complex than the lan
8、guages the computer actually understands,which are called machine languages.Each different type of CPU(Central Processing Unit)has its own unique machine language.简单地与人类语言相比,高级程序设计语言比计算机实际识简单地与人类语言相比,高级程序设计语言比计算机实际识别的语言,也就是机器语言,复杂得多。不同型号的别的语言,也就是机器语言,复杂得多。不同型号的CPU(中央处理单元)都有它独自的一套机器语言。(中央处理单元)都有它独自的一
9、套机器语言。7.1 Introduction to Programming Language第7页/共37页Lying between machine languages and high-level languages are assembly languages,which are directly related to a computers machine language.In other words,it takes one assembly command to generate each machine-language command.Machine languages co
10、nsist entirely of numbers and are almost impossible for humans to read and write.Assembly languages have the same structure and set of commands as machine languages,but they enable a programmer to use names instead of numbers.处于机器语言和高级语言之间的是汇编语言,它直接与机器处于机器语言和高级语言之间的是汇编语言,它直接与机器语言相关;也就是说,它可将一个汇编指令生成一
11、个机器语语言相关;也就是说,它可将一个汇编指令生成一个机器语言指令。人们几乎不可能去读和写那些只包含数字的机器语言指令。人们几乎不可能去读和写那些只包含数字的机器语言。虽然汇编语言具有和机器语言相同的结构和命令集,但言。虽然汇编语言具有和机器语言相同的结构和命令集,但是编程人员可以使用助记符来代替数字。是编程人员可以使用助记符来代替数字。7.1 Introduction to Programming Language第8页/共37页Each type of CPU has its own machine language and assembly language,so an assembly
12、 language program written for one type of CPU wont run on another.In the early days of programming,all programs were written in assembly languages.Now,most programs are written in a high-level language such as FORTRAN or C.Programmers still use assembly languages when speed is essential or when they
13、 need to perform an operation that isnt possible in a high-level language.每种类型的每种类型的CPU都有它自身的机器语言和汇编语言,因此都有它自身的机器语言和汇编语言,因此为一种为一种CPU编写的汇编语言不能运行于其它的编写的汇编语言不能运行于其它的CPU之上。之上。在程序设计的早期,所有的程序都是用汇编语言编写的。而在程序设计的早期,所有的程序都是用汇编语言编写的。而现在,大部分程序都是用像现在,大部分程序都是用像FORTRAN 或或 C这样的高级程这样的高级程序编写的。但当对运行速度要求很高,或执行一个高级语言序编写
14、的。但当对运行速度要求很高,或执行一个高级语言无法处理的操作时,编程人员仍旧会选择汇编语言。无法处理的操作时,编程人员仍旧会选择汇编语言。7.1 Introduction to Programming Language第9页/共37页Lying above high-level languages are those called fourth-generation languages(usually abbreviated 4GL).4GLs are far removed from machine languages and represent the class of computer
15、languages closest to human languages.Most 4GLs are used to access databases.For example,a typical 4GL command is:FIND ALL RECORDS WHERE NAME IS“SMITH”.位于高级语言之上的是第四代程序设计语言(简称位于高级语言之上的是第四代程序设计语言(简称4GL),),它与机器语言差异更大,代表了与人类语言更为接近的那类它与机器语言差异更大,代表了与人类语言更为接近的那类计算机程序设计语言。大多数计算机程序设计语言。大多数4GL被用于进行访问数据库的被用于进行访
16、问数据库的操作。例如,一条典型的操作。例如,一条典型的4GL是:是:FIND ALL RECORDS WHERE NAME IS“SMITH”(查找所有记录中姓名是(查找所有记录中姓名是“SMITH”的记录)。的记录)。7.1 Introduction to Programming Language第10页/共37页More recently,a new type of programming language has emerged that supports Object Oriented Programming(OOP),including C+,Microsoft Visual C+,
17、Visual Foxpro,and Visual Java.OOP is a type of programming in which programmers define not only the data type of a data structure,but also the types of operations(functions,or methods)that can be applied to the data structure.近来出现的新的程序设计语言,像近来出现的新的程序设计语言,像C+,微软的,微软的Visual C+,Visual Foxpro,和,和Visual
18、Java,他们都支持面向对象的程,他们都支持面向对象的程序设计(序设计(OOP)技术。)技术。OOP这种程序设计要求编程人员不这种程序设计要求编程人员不仅要给出数据结构中的数据类型的定义,还需要给出作用在仅要给出数据结构中的数据类型的定义,还需要给出作用在这些数据结构之上的操作(函数,或方法)的类型。这些数据结构之上的操作(函数,或方法)的类型。7.1 Introduction to Programming Language第11页/共37页In this way,the data structure becomes an object that includes both data and
19、functions.In addition,programmers can create relationships between one object and another.For example,objects can inherit characteristics from other objects.One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmer
20、s to create modules that do not need to be changed when a new type of object is added.这样,可使得数据结构成为一个既包含数据又包含函数的对这样,可使得数据结构成为一个既包含数据又包含函数的对象。此外,编程人员可以创建对象间的关系,例如,一个对象。此外,编程人员可以创建对象间的关系,例如,一个对象可以继承其它对象的一些特性。相对于过程式的程序设计象可以继承其它对象的一些特性。相对于过程式的程序设计技术,面向对象的程序设计技术的一个主要优点是:当创建技术,面向对象的程序设计技术的一个主要优点是:当创建一个新类型的
21、对象时,已有的模块不需要发生改变。一个新类型的对象时,已有的模块不需要发生改变。7.1 Introduction to Programming Language第12页/共37页A programmer can simply create a new object that inherits many of its features from existing objects.This makes object-oriented programs easier to modify.To perform object-oriented programming,one needs an objec
22、t-oriented programming language(OOPL).C+and Small talk are two of the more popular languages,and there are also object-oriented versions of Pascal.编程人员可以很方便地创建一个新对象,使它的许多特征继编程人员可以很方便地创建一个新对象,使它的许多特征继承于已存在对象,这使得面向对象的程序更容易修改。为了承于已存在对象,这使得面向对象的程序更容易修改。为了运行面向对象的程序设计,需要一种面向对象的程序设计语运行面向对象的程序设计,需要一种面向对象的程序
23、设计语言(言(OOPL)。)。C+和和Smalltalk是其中最流行的两种语言,是其中最流行的两种语言,当然也有当然也有Pascal的面向对象的版本。的面向对象的版本。7.1 Introduction to Programming Language第13页/共37页All high-level language programs must be translated into machine language so that the computer can understand it.There are two ways to do this:compile the program or i
24、nterpret the program.所有的高级语言程序只有在翻译成机器语言后,才能被计算所有的高级语言程序只有在翻译成机器语言后,才能被计算机执行。翻译有两种方式:编译和解释。机执行。翻译有两种方式:编译和解释。7.1 Introduction to Programming Language第14页/共37页The question of which language is best is one that consumes a lot of time and energy among computer professionals.Every language has its stren
25、gths and weaknesses.For example,FORTRAN is a particularly good language for processing numerical data,but it does not lend itself very well to organizing large programs.到底哪种语言最好是一个困扰业界专家很长时间和消耗他们到底哪种语言最好是一个困扰业界专家很长时间和消耗他们很多精力的问题。每种语言都各有优劣,例如,像很多精力的问题。每种语言都各有优劣,例如,像FORTRAN语言,适合于处理数值计算,但却不适合组织大语言,适合于处
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机专业英语 计算机专业 英语 谢希仁 第二 讲义
限制150内