版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
TextA:ProgrammingFundamentals下一页返回TextA:ProgrammingFundamentalsTheprogramminglanguageisthevocabularyandsetofgrammaticalrulesforinstructingacomputertoperformspecifictasks.Thetermprogramminglanguageusuallyreferstohigh-levellanguage,suchasBASIC,C,C++,COBOL,FORTRAN,Ada,andPascal.Eachlanguagehasauniquesetofkeywords(wordsthatitunderstands)andaspecialsyntaxfororganizingprograminstructions.上一页下一页返回TextA:ProgrammingFundamentalsHigh-levelprogramminglanguages,whilesimplecomparedtohumanlanguages,aremorecomplexthanthelanguagesthecomputeractuallyunderstands,whicharecalledmachinelanguages.EachdifferenttypeofCPUhasitsownuniquemachinelanguage.Lyingbetweenmachinelanguagesandhigh-levellanguagesarelanguagescalledassemblylanguages.Assemblylanguagesaresimilartomachinelanguages,buttheyaremucheasiertoprograminbecausetheyallowaprogrammertosubstitutenamesfornumbers.Machinelanguagesconsistofnumbersonly.上一页下一页返回TextA:ProgrammingFundamentalsLyingabovehigh-levellanguagesarelanguagescalledfourth-generationlanguages(usuallyabbreviated4GL).4GLsarefarremovedfrommachinelanguagesandrepresenttheclassofcomputerlanguagesclosesttohumanlanguages.Regardlessofwhatlanguageyouuse,youeventuallyneedtoconvertyourprogramintomachinelanguagesothatthecomputercanunderstandit.Therearetwowaystodothis.上一页下一页返回TextA:ProgrammingFundamentals(1)TocompiletheprogramHere,itistotransformaprogramwritteninahigh-levelprogramminglanguagefromsourcecodeintoobjectcode.Programmerswriteprogramsinaformcalledsourcecode.Sourcecodemustgothroughseveralstepsbeforeitbecomesanexecutableprogram.Thefirststepistopassthesourcecodethroughacompiler,whichtranslatesthehigh-levellanguageinstructionsintoobjectcode.上一页下一页返回TextA:ProgrammingFundamentalsThefinalstepinproducinganexecutableprogram—afterthecompilerhasproducedobjectcode—istopasstheobjectcodethroughalinker.Thelinkercombinesmodulesandgivesrealvaluestoallsymbolicaddresses,therebyproducingmachinecode.上一页下一页返回TextA:ProgrammingFundamentals(2)TointerprettheprogramAninterpretertranslateshigh-levelinstructionsintoanintermediateform,whichitthenexecutes.Incontrast,acompilertranslateshigh-levelinstructionsdirectlyintoamachinelanguage.Compiledprogramsgenerallyrunfasterthaninterpretedprograms.Theadvantageofaninterpreter,however,isthatitdoesnotneedtogothroughthecompilationstageduringwhichmachineinstructionsaregenerated.Thisprocesscanbetime-consumingiftheprogramislong.Theinterpreter,ontheotherhand,canimmediatelyexecutehigh-levelprograms.Forthisreason,interpretersaresometimesusedduringthedevelopmentofaprogram,whenaprogrammerwantstoaddsmallsectionsatatimeandtestthemquickly.Inaddition,interpretersareoftenusedineducationbecausetheyallowstudentstoprograminteractively.上一页下一页返回TextA:ProgrammingFundamentalsBothinterpretersandcompilersareavailableformosthigh-levellanguages.However,BASICandLISPareespeciallydesignedtobeexecutedbyaninterpreter.Inaddition,pagedescriptionlanguages,suchasPostScript,useaninterpreter.EveryPostScriptprinter,forexample,hasabuiltininterpreterthatexecutesPostScriptinstructions.上一页下一页返回TextA:ProgrammingFundamentalsThequestionofwhichlanguageisbestisonethatconsumesalotoftimeandenergyamongcomputerprofessionals.Everylanguagehasitsstrengthsandweaknesses.Forexample,FORTRANisaparticularlygoodlanguageforprocessingnumericaldata,butitdoesnotlenditselfverywelltoorganizinglargeprograms.Pascalisverygoodforwritingwellstructuredandreadableprograms,butitisnotasflexibleastheCprogramminglanguage.C++embodiespowerfulobjectorientedfeatures,butitiscomplexanddifficulttolearn.Thechoiceofwhichlanguagetousedependsonthetypeofcomputertheprogramistorunon,whatsortofprogramitis,andtheexpertiseoftheprogrammer.上一页下一页返回TextA:ProgrammingFundamentalsWordsandExpressionsprogramminglanguage:编程语言;程序设计语言keyword:n.关键字syntax:n.语法;句法comparedto:与……相比machinelanguage:n.机器语言assemblylanguage:n.汇编语言substitute:vt.代替fourthgenerationlanguage:第4代语言represent:vt.代表compile:vt.编制;编辑
上一页下一页返回TextA:ProgrammingFundamentalssourcecode:源代码objectcode:目标代码executableprogram:可执行程序linker:n.连接器;链接程序module:n.模块;组件value:n.值;参数symbolicaddress:符号地址machinecode:机器代码,机器编码上一页下一页返回TextA:ProgrammingFundamentalsinterpreter:n.翻译器(参考compiler:编译器)intermediate:adj.中间的,中级的interactively:adv.交互式地builtin:adj.嵌入的;固定的n.内置strength:n.优势;优点weakness:n.劣势;缺点numericaldata:数值数据readable:adj.可读的flexible:adj.灵活的;可变通的;有弹性的embody:vt.体现expertise:n.专门知识;专门技术上一页下一页返回TextA:ProgrammingFundamentalsNotes①Assemblylanguagesaresimilartomachinelanguages,buttheyaremucheasiertoprograminbecausetheyallowaprogrammertosubstitutenamesfornumbers.Machinelanguagesconsistofnumbersonly.②Regardlessofwhatlanguageyouuse,youeventuallyneedtoconvertyourprogramintomachinelanguagesothatthecomputercanunderstandit.③Thechoiceofwhichlanguagetousedependsonthetypeofcomputertheprogramistorunon,whatsortofprogramitis,andtheexpertiseoftheprogrammer.上一页返回TextB:ProgramDevelopmentToolsProgramminglanguagesareclassifiedintofivemajorcategories:machinelanguages,assemblylanguages,thirdgenerationlanguages,fourthgenerationlanguages,andnaturallanguages.Machineandassemblylanguagesarereferredtoaslowlevellanguages;thirdgeneration,fourthgenerationandnaturallanguagesarecalledhighlevellanguages.Alowlevellanguageiswrittentorunononeparticularcomputer.Ahighlevellanguagecanrunonmanydifferenttypesofcomputer.下一页返回TextB:ProgramDevelopmentTools1.MachineLanguagesMachinelanguage,whichisalsocalledthefirstgenerationlanguage,sometimesreferredtoasmachinecodeorobjectcode,isacollectionofbinarydigitsorbits(1sand0s)thatthecomputerreadsandinterprets.Machinelanguageistheonlylanguageacomputeriscapableofunderstanding.Moreover,machinelanguageprogramsrunonlyonthecomputerforwhichtheyweredeveloped,thatis,theyaremachinedependent.Onedisadvantageofmachinelanguageprogramsthenisthattheyarenotportabletoothercomputers.Second,asyoumightimagine,codinginthe1sand0sofmachinelanguagecanbetediousandtimeconsuming.上一页下一页返回TextB:ProgramDevelopmentTools2.AssemblyLanguagesBecausemachinelanguageprogramsaresodifficulttowrite,thesecondgenerationofprogramminglanguages,calledassemblylanguages,evolved.Assemblylanguageswerefirstdevelopedinthe1950s,whentheywerereferredtoassecondgenerationprogramminglanguages.Theyeliminatedmuchoftheerrorproneandtimeconsumingproceduresfirstgenerationprogrammingneededwiththeearliestcomputers,freeingtheprogrammerfromtediumsuchasrememberingnumericcodesandcalculatingaddresses.Withanassemblylanguage,instructionswerewrittenusingabbreviations.Aswithmachinelanguages,assemblylanguagesareoftendifficulttolearnandaremachinedependent.上一页下一页返回TextB:ProgramDevelopmentToolsAssemblylanguagesdohaveseveraladvantagesovermachinelanguages.Insteadofusingaseriesofbits,theprogrammerusesmeaningfulabbreviationsforprograminstruction,calledsymbolicinstructioncodes,ormnemonics.Withanassemblylanguage,aprogrammerwritescodessuchasAforaddition,Cforcompare,Lforload,andMformultiply.Anotheradvantageofassemblylanguageisthattheprogrammercanrefertostoragelocationswithsymbolicaddresses.Forexample,insteadofusingtheactualnumericstorageaddressofaunitprice,aprogrammercanusethesymbolicnamePRICE.上一页下一页返回TextB:ProgramDevelopmentToolsOnedisadvantageofanassemblylanguageprogramisthatitmustbetranslatedintomachinelanguagebeforethecomputercanunderstandit.Theprogramcontainingtheassemblylanguagecodeiscalledthesourceprogram.Thecomputercannotunderstandorexecutethissourceprogramuntilitistranslated.Autilityprogramcalledanassemblerisusedtotranslateassemblylanguagestatementsintothetargetcomputer’smachinecode.Theassemblerperformsamoreorlessisomorphictranslation(aonetoonemapping)frommnemonicstatementsintomachineinstructionsanddata.上一页下一页返回TextB:ProgramDevelopmentTools3.ThirdGenerationLanguagesTheintroductionofthecompilerin1952spurredthedevelopmentofthirdgenerationcomputerlanguages.TheselanguagesenableaprogrammertocreateprogramfilesusingcommandsthataresimilartospokenEnglish.Thirdgenerationcomputerlanguageshavebecomethemajormeansofcommunicationbetweenthedigitalcomputeranditsuser.上一页下一页返回TextB:ProgramDevelopmentToolsInformationinasourceprogramisconvertedintotheobjectprogrambyanintermediateprogramcalledaninterpreterorcompiler.Aninterpreterisaprogramthatconverts(orexecutes,inprogrammingjargon)asourceprogram,usuallyonastepbystep,linebyline,orunitbyunitbasis.Thepriceforthisconvenienceisthattheprogramswritteninthirdgenerationlanguagesrequiremorememoryandrunmoreslowlythanthosewritteninlowerlevellanguages.上一页下一页返回TextB:ProgramDevelopmentTools4.FourthGenerationLanguagesFourthgenerationlanguagesattempttomakecommunicatingwithcomputersasmuchliketheprocessesofthinkingandtalkingtootherpeopleaspossible.Theproblemisthatthecomputerstillonlyunderstandszerosandones,soacompilerandinterpretermuststillconvertthesourcecodeintothemachinecodethatthecomputercanunderstand.FourthgenerationlanguagestypicallyconsistofEnglishlikewordsandphrases.Whentheyareimplementedonmicrocomputers,someoftheselanguagesincludegraphicdevicessuchasiconsandonscreenpushbuttonsforuseduringprogrammingandwhenrunningtheresultingapplication.上一页下一页返回TextB:ProgramDevelopmentToolsManyfourthgenerationlanguagesuseStructuredQueryLanguage(SQL)asthebasisforoperations.SQLwasdevelopedatIBMtodevelopinformationstoredinrelationaldatabases.Eventually,itwasadoptedbytheAmericanNationalStandardsInstitute(ANSI)andlaterbytheInternationalStandardsOrganization(ISO)asameansofmanagingstructured,factualdata.ManydatabasecompaniesofferanSQLtypedatabasebecausepurchasersofsuchdatabasesseektooptimizetheirinvestmentsbybuyingopendatabases,i.e.,thoseofferingthegreatestcompatibilitywithothersystems.Thismeansthattheinformationsystemsarerelativelyindependentofvendor,operatingsystem,andcomputerplatform.上一页下一页返回TextB:ProgramDevelopmentTools5.NaturalLanguagesWhereasafourthgenerationlanguageprogrammustfollowaspecificsetofrulesandsyntax,anaturallanguageprogramdoesnot.Anaturallanguage,sometimescalledafifthgenerationlanguage,isatypeofquerylanguagethatallowstheusertoenterrequeststhatresemblehumanspeech.Forexample,anSQLquerytoobtainalistofGPAsthatexceed3.5mightbewrittenasSELECTLAST_NAME,FIRST_NAMEFROMSTUDENTWHEREGPA>3.5.AnaturallanguageversionofthatsamequerymightbewrittenorspokenasTELLMETHENAMESOFSTUDENTSWITHGPAOVER3.5.Fifthgenerationlanguagesareusedmainlyinartificialintelligenceresearch.Prolog,OPS5,andMercuryareexamplesoffifthgenerationlanguages.上一页下一页返回TextB:ProgramDevelopmentToolsWordsandExpressionscategory:n.种类,分类;范畴binarydigit:二进制位advantage:n.优势disadvantage:n.缺点;劣势tedious:adj.沉闷的;冗长乏味的Timeconsuming:adj.花费大量时间的;旷日持久的Errorprone:adj.易于出错的tedium:n.沉闷;单调乏味abbreviation:n.缩写;缩写词上一页下一页返回TextB:ProgramDevelopmentToolsmnemonics:n.助记方法,帮助记忆的公式utilityprogram:应用程序assembler:n.[计]汇编程序;汇编机isomorphic:adj.同构的;同形的spur:vt.激励,鞭策complicated:adj.难懂的,复杂的refinement:n.改进noteworthy:adj.值得注意的;显著的nonprofessional:n.外行;非专业人士routine:n.函数上一页下一页返回TextB:ProgramDevelopmentToolsstorebought:adj.现成的;店里买的sourceprogram:源程序objectprogram:目标程序implement:vt.实施,执行;实现pushbutton:按钮optimize:vt.使最优化artificialintelligencelanguage:人工智能语言querylanguage:查询语言resemble:vt.类似;与……一样version:n.版本上一页下一页返回TextB:ProgramDevelopmentToolsNotes①Assemblylanguagesdohaveseveraladvantagesovermachinelanguages.与机器语言相比较,汇编语言确实有不少优点。②InternationalBusinessMachineCorporation(IBM):国际商业机器公司,或万国商业机器公司,简称IBM上一页下一页返回TextB:ProgramDevelopmentTools③ALGOL(ALGOrithmicLanguage):ALGOL这个名称是算法语言的简称,这种语言不是计算机制造公司为某种特定机器设计的,而是纯粹面向描述计算过程的,也就是所谓面向算法描述的。ALGOL是计算机发展史上首批产生的高级语言,其语法是用严格公式化的方法说明的。
COBOL(CommonBusinessOrientedLanguage):面向商业的通用语言,又称为企业管理语言、数据处理语言等。COBOL是数据处理领域应用最为广泛的程序设计语言,是第一个广泛使用的高级编程语言。上一页下一页返回TextB:ProgramDevelopmentTools④DartmouthCollege:达特茅斯学院,成立于1769年,是美国第9所历史最悠久的学院,也是闻名遐迩的常春藤学院之一,坐落于美国新罕布什尔州的汉诺威(Hanover)小镇。⑤Thiswasthefirstwidespreadcomputerlanguagedesignedforandusedbynonprofessionalprogrammers.
这也是第一款为非专业程序员设计,被非专业程序员广泛使用的计算机语言。⑥Thepriceforthisconvenienceisthattheprogramswritteninthirdgenerationlanguagesrequiremorememoryandrunmoreslowlythanthosewritteninlowerlevellanguages.
这样做方便很多,但代价就是用第3代语言写的程序占据了更多的内存,比机器语言和汇编语言编写的程序运行时更慢。上一页下一页返回TextB:ProgramDevelopmentTools⑦ManyfourthgenerationlanguagesuseStructuredQueryLanguage(SQL)asthebasisforoperations.⑧AmericanNationalStandardsInstitute(ANSI):美国国家标准学InternationalStandardsOrganization(ISO):国际标准化组织⑨ExamplesoffourthgenerationlanguagesincludePROLOG,anartificialintelligencelanguagethatappliesrulestodatatoarriveatsolutions.
第4代计算机语言中就包括PROLOG,这是一种人工智能语言,把逻辑运用到程序编写中,以达到(自动)解决问题之目的。⑩…….anSQLquerytoobtainalistofGPAsthatexceed……
一个想得到GPA值大于3.5的学生姓名列表的SQL查询……上一页返回GrammarFocus一、一般现在时1.概念经常、反复发生的动作或行为及现在的某种状况。2.时间状语
always,usually,often,sometimes,everyweek(day,year,month……),onceaweek,onSundays等。3.用法(1)经常性或习惯性的动作,常与表示频度的时间状语连用。时间状语:every…,sometimes,at…,onSunday等。
(2)客观真理,客观存在,科学事实。
(3)表示格言或警句中。下一页返回GrammarFocus(4)现在时刻的状态、能力、性格、个性。二、一般过去时1.概念过去某个时间里发生的动作或状态;过去习惯性、经常性的动作、行为。2.时间状语
ago,yesterday,thedaybeforeyesterday,lastweek,last(year,night,month…),in1989,justnow,attheageof5,oneday,longlongago,onceuponatime,etc.上一页下一页返回GrammarFocus3.用法(1)在确定的过去时间里所发生的动作或存在的状态。(2)表示在过去一段时间内,经常性或习惯性的动作。三、一般将来时
1.概念表示将要发生的动作或存在的状态及打算、计划或准备做某事。2.时间状语
tomorrow,nextday(week,month,year…),soon,inafewminutes,by…,thedayaftertomorrow,etc.上一页下一页返回GrammarFocus3.用法(1)shall用于第一人称,常被will所代替。will在陈述句中用于各人称,在征求意见时常用于第二人称。WhichparagraphshallIreadfirst.Willyoubeathomeatseventhisevening?(2)begoing+不定式,表示将来。①主语的意图,即将做某事。Whatareyougoingtodotomorrow?②计划,安排要发生的事。Theplayisgoingtobeproducednextmonth.③有迹象要发生的事。上一页下一页返回GrammarFocusLookatthedarkclouds,thereisgoingtobeastorm.(3)be+不定式表将来,按计划或正式安排将发生的事。WearetodiscussthereportnextSaturday.(4)beabout+不定式,意为马上做某事。HeisabouttoleaveforBeijing.上一页下一页返回GrammarFocus四、现在完成时1.概念现在完成时用来表示之前已发生或完成的动作或状态,其结果和现在有联系。动作或状态发生在过去,但它的影响现在还存在;也可表示持续到现在的动作或状态。其构成:have(has)+过去分词。2.时间状语
recently,lately,since…for…,inthepastfewyears,etc.上一页下一页返回GrammarFocus3.用法(1)现在完成时表示到现在为止已完成或仍在持续的动作、状态,强调对现在的影响、联系,或表示经历、经验,即用过去发生的动作来说明现在的情况。(2)现在完成时用在过去已完成而其结果对现在仍有影响的动作来说明经历、经验,或表示某种感情色彩。(3)当现在完成时表示从过去某时持续到现在的动作或状态,以说明经历、经验,与for或since引导的表示一段时间的副词片语连用时,谓语动词要用be,keep,learn,live,read,serve,stay,study,teach,watch,work,write等表示持续的动词,不可使用arrive,become,begin,borrow,buy,c
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年上半年教师资格证中学生物综合素质真题单套试卷
- 辅警招聘考试行政职业能力测验(判断推理)模拟试卷1
- (2025年)耳穴贴压技术考试试题附答案
- 梅州市(2025年)辅警招聘考试题库 (答案+解析)
- (2025年)银行面试问题及答案
- (2025年)卫生管理职业能力测评题及答案
- (2025年)市人民法院面向社会招录司法雇员5人笔试模拟试题及答案解析
- 2026年团内推优理论知识考试试卷及答案
- 南昌市东湖区2025-2026学年第二学期五年级语文期末考试卷(部编版含答案)
- DB43∕T 981-2015 在用电梯能效评价技术导则
- 2026年中考数学压轴题专项练习-阿基米德折弦定理(学生版+名师详解版)
- 2025年凉山州中考语文试题答案解析卷
- 夜间生产管理办法
- 《智慧物流概论》试卷及答案 共2套
- 骨灰堂管理制度
- 2025年巨量创意营销初级1.0考试题库
- GB/T 15561-2024数字指示轨道衡
- 全季酒店培训体系介绍
- 江苏国信电厂笔试题
- 国开(河北)2024年《法律工作者职业道德》形考任务1-4答案
- 语法填空15篇(湖南名校模拟)-2024年中考英语逆袭冲刺名校模拟真题速递(湖南专用)
评论
0/150
提交评论