计算机专业英语Unit-4-Programming-Language课件_第1页
计算机专业英语Unit-4-Programming-Language课件_第2页
计算机专业英语Unit-4-Programming-Language课件_第3页
计算机专业英语Unit-4-Programming-Language课件_第4页
计算机专业英语Unit-4-Programming-Language课件_第5页
已阅读5页,还剩30页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Unit4ProgrammingLanguageSectionAProgrammingLanguageOverviewUnit4ProgrammingLanguageSec1BackgroundKnowledge背景知识计算机使用二进制语言,与人类使用的自然语言差别较大。为了让计算机能理解人类指令并正确去完成相应的任务需要借助于程序设计语言。程序语言的类别很多,在发展的历程上也经历了机器语言、汇编语言和高级语言等若干阶段。BackgroundKnowledge背景知识计算机使用Newwordsandusefulexpressionsgeneration/dʒenə'reiʃn/代,一代,产生,一世syntax/'sintæks/语法;有条理的排列;句法primitive/'prɪmɪtɪv/原始的,旧式的,上古的symbolic/sɪm'bɑlɪk/用符号的(用作符号的)neural/'njurəl/神经的;背侧的;神经中枢的imitate/'ɪmɪteɪt/模仿,冒充,效法switch/swɪtʃ/开关,转换;转换器;instruction/ɪn'strʌkʃn/指示;指令;用法说明Newwordsandusefulexpressio计算机专业英语Unit-4--Programming-Language课件计算机专业英语Unit-4--Programming-Language课件Newwordsandusefulexpressionstime-consuming费时间error-prone易错human-friendly友好的,人容易理解的scriptinglanguage脚本语言parentclass父类embeddedapplication嵌入式应用NewwordsandusefulexpressioContentsProgrammingLanguagesLevel2ProceduralOrientedProgramming4ObjectOrientedProgramming5ProgrammingParadigms3FiveGenerationofLanguages1ContentsProgrammingLanguagesFirstgenerationlanguages(1GL)Representtheveryearly,primitivecomputerlanguagesthatconsistedentirelyof1'sand0's-theactuallanguagethatthecomputerunderstands(machinelanguage).Firstgenerationlanguages(1GLSecondgenerationlanguages(2GL)Representastepupfromthefirstgenerationlanguages.Allowfortheuseofsymbolicnamesinsteadofjustnumbers.Secondgenerationlanguagesareknownasassemblylanguage.Codewritteninanassemblylanguageisconvertedintomachinelanguage(1GL).Secondgenerationlanguages(2GThirdgenerationlanguages(3GL)Wordsandcommandswerebeingused.Havesyntaxthatwasmucheasiertounderstand.includeC,C++,Java,andJavaScript,amongothers.Thirdgenerationlanguages(3GLThesyntaxusedin4GLisveryclosetohumanlanguage,animprovementfromthepreviousgenerationoflanguages.Typicallyusedtoaccessdatabases.Forexample,SQLandColdFusion.Fourthgenerationlanguages(4GL)Thesyntaxusedin4GLisveryDesignedtomakethecomputersolveagivenproblemwithouttheprogrammer.Usedforneuralnetworks(aformofartificialintelligencethatattemptstoimitatehowthehumanmindworks).ForExample:Prolog,OPS5,andMercury.Fifthgenerationlanguages(5GL)DesignedtomakethecomputerContentsProgrammingLanguagesLevel2ProceduralOrientedProgramming4ObjectOrientedProgramming5ProgrammingParadigms3FiveGenerationofLanguages1ContentsProgrammingLanguagesMachineLanguagemachinecodeinstructionswrittenasstringsofbinarydigits("bits").Theprogramminglanguageusedwasknownasbinarycode.Verydifficulttoworkwithduetotheabsenceofsymbolicinformation.MachineLanguagemachinecodeiAssemblyLanguageconsistedofthesetofmnemonicsneededtorepresentthecompleteinstructionsetusedbyaparticularCPU.Needtobeconvertedintomachinecodeinorderforthecomputertoexecutetheprograminstructions,andthiswascarriesoutbyaprogramcalledanassembler.Usedtodaymainlyforembeddedapplicationswherethereisarequirementforcompactandefficientcode,andwheretheamountofmemoryavailablemaybelimited.AssemblyLanguageconsistedofHigh-levellanguagesMorehuman-friendlyprogramminglanguagesbegantoemergethatallowedprogramstobewrittenusingEnglish-likecommands.Needtoconvertintomachinecodefirstforcomputertounderstand.High-levellanguagesMorehumanHigh-levelLanguagesExecutionTwoapproacheshavebeenusedtomaketheconversion.CompilerInterpreterconvertthehigh-levelcodeintomachinecodebeforetheprogramisloadedintothecomputer'sworkingmemory.converteachhigh-levelprograminstructionintomachinecodeatruntime.--executiontendstobeslower.High-levelLanguagesExecutionFORTRANOriginallydevelopedbyIBMin1954Goodatcarryingoutlargenumbersofcomplexcalculations,andisdesignedforuseinscientificandengineeringapplicationsInwidespreaduseandhascontinuedtoevolve.FORTRANOriginallydevelopedbyCOBOLCOBOL(CommonBusiness-OrientedLanguage)wasdesignedspecificallyforuseinbusiness,financialandadministrativeapplications.Approximately75%oftheworld’sbusinessistransactedonsystemswritteninCOBOL.DevelopmentandstandardizationofthelanguageisnowprimarilymanagedbytheInternationalStandardsOrganization(ISO).GraceHopperCOBOLCOBOL(CommonBusiness-OrOtherHigh-levelLanguagesSpecializedlanguagessuchasLISPandProlog(usedforapplicationsinvolvingartificialintelligence)Moregeneral-purposelanguagessuchasC,C++,Perl,JavaandVisualBasic.OtherHigh-levelLanguagesSpecContentsProgrammingLanguagesLevel2ProceduralOrientedProgramming4ObjectOrientedProgramming5ProgrammingParadigms3FiveGenerationofLanguages1ContentsProgrammingLanguagesProgrammingLanguagesCommonFeaturesInput-getdatafromaninputdevicesuchasadiskdriveorthekeyboardOutput-senddatatoanoutputdevicesuchasadiskdrive,visualdisplayunit,printerornetworkadapterArithmeticandlogic-performarithmeticoperationssuchasadditionandmultiplication,andlogicaloperationssuchascomparingthevalueoftwovariablesProgrammingLanguagesCommonFProgrammingLanguagesCommonFeatures-ContinueConditionalexecution-executeadifferentsetofprograminstructionsdependingonwhetheraspecifiedconditionistrueorfalseRepetition-executeasetofprograminstructionsrepeatedlyuntilsomeexitconditionevaluatestotrue(aconditionalloop)orforaspecifiednumberofiterations(acountingloop)ProgrammingLanguagesCommonFContentsProgrammingLanguagesLevel2ProceduralOrientedProgramming4ObjectOrientedProgramming5ProgrammingParadigms3FiveGenerationofLanguages1ContentsProgrammingLanguagesProceduralOrientedProgrammingAstructuredprogrammingparadigmbasedontheconceptofprocedurecalls.Theproceduresmaybesubroutines,methodsorfunctions,eachofwhichconsistsofacollectionofprogramstatementsthatareexecutedsequentiallyinordertocarryoutaspecifictask.ProceduralOrientedProgramminProceduralOrientedProgrammingMeritsMerits:Allowthesamecodetobere-usedrepeatedly.AvoidtheneedtousetheGOTOorJUMPstatementsfoundinunstructuredlanguages–avoid"spaghetticode".Suitedtomodularization.--reducetheoverallcomplexityofalargeapplicationbyorganizingtheapplicationscodeintorelatedfunctionalunits.ProceduralOrientedProgrammin26ContentsProgrammingLanguagesLevel2ProceduralOrientedProgramming4ObjectOrientedProgramming5ProgrammingParadigms3FiveGenerationofLanguages1ContentsProgrammingLanguagesObjectOrientedProgrammingAprogrammingparadigmthatusesobjectstomodeldataentities.Placestheemphasisonthedataratherthanonthefunctionscarriedoutbytheprogram.Objectsinteractwiththeapplication'susersandwitheachotherbysendingandreceivingmessages.(Themessagestowhichanobjectwillrespondaredefinedbytheobject'sinterface)ObjectOrientedProgrammingApObjectOrientedProgrammingComponentsClassvariables-belongtotheclassasawhole;thereisonlyonecopyofeachone.Instancevariablesorattributes-datathatbelongstoindividualobjects;everyobjecthasitsowncopyofeachone.Membervariables-referstoboththeclassandinstancevariablesthataredefinedbyaparticularclassObjectOrientedProgrammingCo29ObjectOrientedProgrammingComponents-ContinueClassmethods-belongtotheclassasawholeandhaveaccessonlytoclassvariablesandinputsfromtheprocedurecallInstancemethods-belongtoindividualobjects,andhaveaccesstoinstancevariablesforthespecificobjecttheyarecalledon,inputs,andclassvariablesObjectOrientedProgrammingCoEncapsulationAnobject'smembervariablesaredeclaredasprivate,andcanonlybeaccessedormodifiedbytheobject'sownmethods.Themethodsthemselvesareusuallydeclaredtobepublic,butthemannerinwhichtheymaybeinvokedisstrictlydefinedbytheobject'sinterface.Encapsulation:Theabilitytohideboththedataandthecodeimplementationofanobjectbehindtheobject'sinterface.EncapsulationAnobject'smembeInheritanceeachobjectisderivedfromatemplateobjectcalledaclass.Theclassdefinesthemembervariables,methods,andinterfaceforeachobjectcreatedfromit.subclasseswouldinheritthemembervariables,methodsandinterfaceoftheparentclass.Theabilityofasubclasstoinheritthec

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论