计算机专业英语Unit-4--Programming-Language课件

上传人:风*** 文档编号:240931153 上传时间:2024-05-18 格式:PPTX 页数:35 大小:5.53MB
返回 下载 相关 举报
计算机专业英语Unit-4--Programming-Language课件_第1页
第1页 / 共35页
计算机专业英语Unit-4--Programming-Language课件_第2页
第2页 / 共35页
计算机专业英语Unit-4--Programming-Language课件_第3页
第3页 / 共35页
点击查看更多>>
资源描述
Unit 4 Programming LanguageSection A Programming Language OverviewUnit 4 Programming LanguageSec1Computer EnglishBackground Knowledge 背景知背景知识v计算机使用二进制语言,与人类使用的自然语言差别较大。计算机使用二进制语言,与人类使用的自然语言差别较大。为了让计算机能理解为了让计算机能理解人类指令人类指令并正确去完成相应的任务需并正确去完成相应的任务需要借助于程序设计语言。要借助于程序设计语言。v程序语言的类别很多,在发展的历程上也经历了机器语言、程序语言的类别很多,在发展的历程上也经历了机器语言、汇编语言和高级语言等若干阶段。汇编语言和高级语言等若干阶段。Background Knowledge 背景知识计算机使用Computer EnglishNew words and useful expressionsgeneration/denrein/代,一代,产生,一世syntax /sintks/语法;有条理的排列;句法primitive/prmtv/原始的,旧式的,上古的symbolic/smblk/用符号的(用作符号的)neural/njurl/神经的;背侧的;神经中枢的imitate/mtet/模仿,冒充,效法switch/swt/开关,转换;转换器;instruction/nstrkn/指示;指令;用法说明New words and useful expressioComputer English计算机专业英语Unit-4-Programming-Language课件Computer English计算机专业英语Unit-4-Programming-Language课件Computer EnglishNew words and useful expressionstime-consuming费时间error-prone易错human-friendly友好的,人容易理解的scripting language脚本语言parent class父类embedded application嵌入式应用New words and useful expressioComputer EnglishContentsProgramming Languages Level2Procedural Oriented Programming4Object Oriented Programming5Programming Paradigms3Five Generation of Languages1ContentsProgramming Languages L o g oFirst generation languages(1GL)vRepresent the very early,primitive computer languages that consisted entirely of 1s and 0s-the actual language that the computer understands(machine language).First generation languages(1GLL o g oSecond generation languages(2GL)vRepresent a step up from the first generation languages.vAllow for the use of symbolic names instead of just numbers.vSecond generation languages are known as assembly language.vCode written in an assembly language is converted into machine language(1GL).Second generation languages(2GL o g oThird generation languages(3GL)vWords and commands were being used.vHave syntax that was much easier to understand.vinclude C,C+,Java,and JavaScript,among others.Third generation languages(3GLL o g ovThe syntax used in 4GL is very close to human language,an improvement from the previous generation of languages.vTypically used to access databases.For example,SQL and ColdFusion.Fourth generation languages(4GL)The syntax used in 4GL is veryL o g ovDesigned to make the computer solve a given problem without the programmer.vUsed for neural networks(a form of artificial intelligence that attempts to imitate how the human mind works).vFor Example:Prolog,OPS5,and Mercury.Fifth generation languages(5GL)Designed to make the computer L o g oContentsProgramming Languages Level2Procedural Oriented Programming4Object Oriented Programming5Programming Paradigms3Five Generation of Languages1ContentsProgramming Languages L o g oMachine Languagevmachine code instructions written as strings of binary digits(bits).vThe programming language used was known as binary code.vVery difficult to work with due to the absence of symbolic information.Machine Languagemachine code iL o g oAssembly Languagevconsisted of the set of mnemonics needed to represent the complete instruction set used by a particular CPU.vNeed to be converted into machine code in order for the computer to execute the program instructions,and this was carries out by a program called an assembler.vUsed today mainly for embedded applications where there is a requirement for compact and efficient code,and where the amount of memory available may be limited.Assembly Languageconsisted of L o g oHigh-level languagesvMore human-friendly programming languages began to emerge that allowed programs to be written using English-like commands.vNeed to convert into machine code first for computer to understand.High-level languagesMore humanL o g oHigh-level Languages ExecutionvTwo approaches have been used to make the conversion.CompilerInterpreterconvert the high-level code into machine code before the program is loaded into the computers working memory.convert each high-level program instruction into machine code at run time.-execution tends to be slower.High-level Languages ExecutionL o g oFORTRANvOriginally developed by IBM in 1954vGood at carrying out large numbers of complex calculations,and is designed for use in scientific and engineering applicationsvIn widespread use and has continued to evolve.FORTRANOriginally developed byL o g oCOBOLvCOBOL(Common Business-Oriented Language)was designed specifically for use in business,financial and administrative applications.vApproximately 75%of the worlds business is transacted on systems written in COBOL.vDevelopment and standardization of the language is now primarily managed by the International Standards Organization(ISO).Grace HopperCOBOLCOBOL(Common Business-OrL o g oOther High-level LanguagesvSpecialized languages such as LISP and Prolog(used for applications involving artificial intelligence)vMore general-purpose languages such as C,C+,Perl,Java and Visual Basic.Other High-level LanguagesSpecL o g oContentsProgramming Languages Level2Procedural Oriented Programming4Object Oriented Programming5Programming Paradigms3Five Generation of Languages1ContentsProgramming Languages L o g oProgramming Languages Common FeaturesvInput-get data from an input device such as a disk drive or the keyboardvOutput-send data to an output device such as a disk drive,visual display unit,printer or network adaptervArithmetic and logic-perform arithmetic operations such as addition and multiplication,and logical operations such as comparing the value of two variablesProgramming Languages Common FL o g oProgramming Languages Common Features-ContinuevConditional execution-execute a different set of program instructions depending on whether a specified condition is true or falsevRepetition-execute a set of program instructions repeatedly until some exit condition evaluates to true(a conditional loop)or for a specified number of iterations(a counting loop)Programming Languages Common FL o g oContentsProgramming Languages Level2Procedural Oriented Programming4Object Oriented Programming5Programming Paradigms3Five Generation of Languages1ContentsProgramming Languages L o g oProcedural Oriented ProgrammingvA structured programming paradigm based on the concept of procedure calls.vThe procedures may be subroutines,methods or functions,each of which consists of a collection of program statements that are executed sequentially in order to carry out a specific task.Procedural Oriented ProgramminL o g oProcedural Oriented Programming MeritsvMerits:Allow the same code to be re-used repeatedly.vAvoid the need to use the GOTO or JUMP statements found in unstructured languages avoid spaghetti code.vSuited to modularization.-reduce the overall complexity of a large application by organizing the applications code into related functional units.Procedural Oriented Programmin26L o g oContentsProgramming Languages Level2Procedural Oriented Programming4Object Oriented Programming5Programming Paradigms3Five Generation of Languages1ContentsProgramming Languages L o g oObject Oriented ProgrammingvA programming paradigm that uses objects to model data entities.vPlaces the emphasis on the data rather than on the functions carried out by the program.vObjects interact with the applications users and with each other by sending and receiving messages.(The messages to which an object will respond are defined by the objects interface)Object Oriented ProgrammingA pL o g oObject Oriented Programming ComponentsvClass variables-belong to the class as a whole;there is only one copy of each one.vInstance variables or attributes-data that belongs to individual objects;every object has its own copy of each one.vMember variables-refers to both the class and instance variables that are defined by a particular classObject Oriented Programming Co29L o g oObject Oriented Programming Components-ContinuevClass methods-belong to the class as a whole and have access only to class variables and inputs from the procedure callvInstance methods-belong to individual objects,and have access to instance variables for the specific object they are called on,inputs,and class variablesObject Oriented Programming CoL o g oEncapsulationvAn objects member variables are declared as private,and can only be accessed or modified by the objects own methods.vThe methods themselves are usually declared to be public,but the manner in which they may be invoked is strictly defined by the objects interface.vEncapsulation:The ability to hide both the data and the code implementation of an object behind the objects interface.EncapsulationAn objects membeL o g oInheritanceveach object is derived from a template object called a class.The class defines the member variables,methods,and interface for each object created from it.vsubclasses would inherit the member variables,methods and interface of the parent class.vThe ability of a subclass to inherit the characteristics of its parent class in this way is called inheritance.Inheritanceeach object is deriL o g oPolymorphismvWhen calling code can be agnostic as to whether an object belongs to a parent class or one of its descendants.For example,a function might call make_full_name()on an object,which will work whether the object is of class Person or class Employee.PolymorphismWhen calling code L o g oObject Oriented Programming ExamplevSimula is generally thought to be the first programming language to display object-oriented characteristicsvThe first truly object-oriented language is held by many to be Smalltalk.Object Oriented Programming ExL o g oObject Oriented Programming Gaining PopularityvIt was not until the 1990s that object-oriented programming emerged as the predominant programming paradigm,probably due to the rise in popularity of the graphical user interface(GUI),for which an object-oriented approach is ideally suited.GUIObject Oriented Programming Ga
展开阅读全文
相关资源
相关搜索

最新文档


当前位置:首页 > 办公文档 > 教学培训


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!