版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 新版苏教版四年级科学上册复习要点梳理
- 初中英语口语教学设计的真实情境模拟
- 教学相长北师大百分数教学的反思与实践分享
- 一年级语文词语复习策略
- 苏教版四年级下册语文学习资料
- 千米苏教版教材教学案例分享
- 秋游中的新北师大版数学二上课堂实践
- 年春季四年级下册音乐苏教版教案
- 北师大丑石课件的创新与实践
- 高中美术人教版教案实践与教学效果分析
- DB32∕T 2547-2013 石油化工码头及库区安全设施配备目录和技术要求
- 武汉大学抬头信签纸
- 软土路基的五种处理方法(ppt)
- 延续护理服务-PPT课件
- 低压配电网设计之低压架空线路
- 公路水毁塌方清理交通中断应急演练方案脚本
- 金风变桨系统
- 电动汽车充电基础设施规划设计标准(DB11T-1455-2017)
- 麻醉科技术操作规程完整
- IBM与吉利职位体系
- 金刚砂地坪出现裂缝的原因及解决方案
评论
0/150
提交评论