英文文献及翻译计算机程序.docx

上传人:b****1 文档编号:2965056 上传时间:2023-05-05 格式:DOCX 页数:10 大小:23.05KB
下载 相关 举报
英文文献及翻译计算机程序.docx_第1页
第1页 / 共10页
英文文献及翻译计算机程序.docx_第2页
第2页 / 共10页
英文文献及翻译计算机程序.docx_第3页
第3页 / 共10页
英文文献及翻译计算机程序.docx_第4页
第4页 / 共10页
英文文献及翻译计算机程序.docx_第5页
第5页 / 共10页
英文文献及翻译计算机程序.docx_第6页
第6页 / 共10页
英文文献及翻译计算机程序.docx_第7页
第7页 / 共10页
英文文献及翻译计算机程序.docx_第8页
第8页 / 共10页
英文文献及翻译计算机程序.docx_第9页
第9页 / 共10页
英文文献及翻译计算机程序.docx_第10页
第10页 / 共10页
亲,该文档总共10页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

英文文献及翻译计算机程序.docx

《英文文献及翻译计算机程序.docx》由会员分享,可在线阅读,更多相关《英文文献及翻译计算机程序.docx(10页珍藏版)》请在冰点文库上搜索。

英文文献及翻译计算机程序.docx

英文文献及翻译计算机程序

文件编码(GHTU-UITID-GGBKT-POIU-WUUI-8968)

 

英文文献及翻译计算机程序

姓名:

刘峻霖班级:

通信143班学号:

2014101108

ComputerLanguageandProgramming

I.Introduction

Programminglanguages,incomputerscience,aretheartificiallanguagesusedtowriteasequenceofinstructions(acomputerprogram)thatcanberunbyacomputer.Similartonaturallanguages,suchasEnglish,programminglanguageshaveavocabulary,grammar,andsyntax.However,naturallanguagesarenotsuitedforprogrammingcomputersbecausetheyareambiguous,meaningthattheirvocabularyandgrammaticalstructuremaybeinterpretedinmultipleways.Thelanguagesusedtoprogramcomputersmusthavesimplelogicalstructures,andtherulesfortheirgrammar,spelling,andpunctuationmustbeprecise.

Programminglanguagesvarygreatlyintheirsophisticationandintheirdegreeofversatility.Someprogramminglanguagesarewrittentoaddressaparticularkindofcomputingproblemorforuseonaparticularmodelofcomputersystem.Forinstance,programminglanguagessuchasFORTRANandCOBOLwerewrittentosolvecertaingeneraltypesofprogrammingproblems—FORTRANforscientificapplications,andCOBOLforbusinessapplications.Althoughtheselanguagesweredesignedtoaddressspecificcategoriesofcomputerproblems,theyarehighlyportable,meaningthattheymaybeusedtoprogrammanytypesofcomputers.Otherlanguages,suchasmachinelanguages,aredesignedtobeusedbyonespecificmodelofcomputersystem,orevenbyonespecificcomputerincertainresearchapplications.Themostcommonlyusedprogramminglanguagesarehighlyportableandcanbeusedtoeffectivelysolvediversetypesofcomputingproblems.LanguageslikeC,PASCALandBASICfallintothiscategory.

II.LanguageTypes

Programminglanguagescanbeclassifiedaseitherlow-levellanguagesorhigh-levellanguages.Low-levelprogramminglanguages,ormachinelanguages,arethemostbasictypeofprogramminglanguagesandcanbeunderstooddirectlybyacomputer.Machinelanguagesdifferdependingonthemanufacturerandmodelofcomputer.High-levellanguagesareprogramminglanguagesthatmustfirstbetranslatedintoamachinelanguagebeforetheycanbeunderstoodandprocessedbyacomputer.Examplesofhigh-levellanguagesareC,C++,PASCAL,andFORTRAN.Assemblylanguagesareintermediatelanguagesthatareveryclosetomachinelanguagesanddonothavetheleveloflinguisticsophisticationexhibitedbyotherhigh-levellanguages,butmuststillbetranslatedintomachinelanguage.

1.MachineLanguages

Inmachinelanguages,instructionsarewrittenassequencesof1sand0s,calledbits,thatacomputercanunderstanddirectly.Aninstructioninmachinelanguagegenerallytellsthecomputerfourthings:

(1)wheretofindoneortwonumbersorsimplepiecesofdatainthemaincomputermemory(RandomAccessMemory,orRAM),

(2)asimpleoperationtoperform,suchasaddingthetwonumberstogether,(3)whereinthemainmemorytoputtheresultofthissimpleoperation,and(4)wheretofindthenextinstructiontoperform.Whileallexecutableprogramsareeventuallyreadbythecomputerinmachinelanguage,theyarenotallprogrammedinmachinelanguage.Itisextremelydifficulttoprogramdirectlyinmachinelanguagebecausetheinstructionsaresequencesof1sand0s.Atypicalinstructioninamachinelanguagemightread1001011001011andmeanaddthecontentsofstorageregisterAtothecontentsofstorageregisterB.

2.High-LevelLanguages

High-levellanguagesarerelativelysophisticatedsetsofstatementsutilizingwordsandsyntaxfromhumanlanguage.Theyaremoresimilartonormalhumanlanguagesthanassemblyormachinelanguagesandarethereforeeasiertouseforwritingcomplicatedprograms.Theseprogramminglanguagesallowlargerandmorecomplicatedprogramstobedevelopedfaster.However,high-levellanguagesmustbetranslatedintomachinelanguagebyanotherprogramcalledacompilerbeforeacomputercanunderstandthem.Forthisreason,programswritteninahigh-levellanguagemaytakelongertoexecuteanduseupmorememorythanprogramswritteninanassemblylanguage.

3.AssemblyLanguages

Computerprogrammersuseassemblylanguagestomakemachine-languageprogramseasiertowrite.Inanassemblylanguage,eachstatementcorrespondsroughlytoonemachinelanguageinstruction.Anassemblylanguagestatementiscomposedwiththeaidofeasytoremembercommands.ThecommandtoaddthecontentsofthestorageregisterAtothecontentsofstorageregisterBmightbewrittenADDB,Ainatypicalassemblylanguagestatement.Assemblylanguagessharecertainfeatureswithmachinelanguages.Forinstance,itispossibletomanipulatespecificbitsinbothassemblyandmachinelanguages.Programmersuseassembly

languageswhenitisimportanttominimizethetimeittakestorunaprogram,becausethetranslationfromassemblylanguagetomachinelanguageisrelativelysimple.Assemblylanguagesarealsousedwhensomepartofthecomputerhastobecontrolleddirectly,suchasindividualdotsonamonitorortheflowofindividualcharacterstoaprinter.

III.ClassificationofHigh-LevelLanguages

High-levellanguagesarecommonlyclassifiedasprocedure-oriented,functional,object-oriented,orlogiclanguages.Themostcommonhigh-levellanguagestodayareprocedure-orientedlanguages.Intheselanguages,oneormorerelatedblocksofstatementsthatperformsomecompletefunctionaregroupedtogetherintoaprogrammodule,orprocedure,andgivenanamesuchas“procedureA.”Ifthesamesequenceofoperationsisneededelsewhereintheprogram,asimplestatementcanbeusedtoreferbacktotheprocedure.Inessence,aprocedureisjusta

mini-program.Alargeprogramcanbeconstructedbygroupingtogetherproceduresthatperformdifferenttasks.Procedurallanguagesallowprogramstobeshorterandeasierforthecomputertoread,buttheyrequiretheprogrammertodesigneachproceduretobegeneralenoughtobeused

indifferentsituations.Functionallanguagestreatprocedureslikemathematicalfunctionsandallowthemtobeprocessedlikeanyotherdatainaprogram.Thisallowsamuchhigherandmorerigorouslevelofprogramconstruction.Functionallanguagesalsoallowvariables—symbolsfordatathatcanbespecifiedandchangedbytheuserastheprogramisrunning—tobegivenvaluesonlyonce.Thissimplifiesprogrammingbyreducingtheneedtobeconcernedwiththeexactorderofstatementexecution,sinceavariabledoesnothavetoberedeclared,orrestated,eachtimeitisusedinaprogramstatement.Manyoftheideasfromfunctionallanguageshavebecomekeypartsofmanymodernprocedurallanguages.Object-orientedlanguagesareoutgrowthsoffunctionallanguages.Inobject-orientedlanguages,thecodeusedtowritetheprogramandthedataprocessedbytheprogramaregroupedtogetherintounitscalledobjects.Objectsarefurthergroupedintoclasses,whichdefinetheattributesobjectsmusthave.AsimpleexampleofaclassistheclassBook.ObjectswithinthisclassmightbeNovelandShortStory.Objectsalsohavecertainfunctionsassociatedwiththem,calledmethods.Thecomputeraccessesanobjectthroughtheuseofoneoftheobject’smethods.Themethodperformssomeactiontothedataintheobjectandreturnsthisvaluetothecomputer.

Classesofobjectscanalsobefurthergroupedintohierarchies,inwhichobjectsofoneclasscaninheritmethodsfromanotherclass.Thestructureprovidedinobject-orientedlanguagesmakesthemveryusefulforcomplicatedprogrammingtasks.Logiclanguagesuselogicastheirmathematicalbase.Alogicprogramconsistsofsetsoffactsandif-thenrules,whichspecifyhowonesetoffactsmaybededucedfromothers,forexample:

IfthestatementXistrue,thenthestatementYisfalse.Intheexecutionofsuchaprogram,aninputstatementcanbelogicallydeducedfromotherstatementsintheprogram.Manyartificialintelligenceprogramsarewritteninsuchlanguages.

IV.LanguageStructureandComponents

Programminglanguagesusespecifictypesofstatements,orinstructions,toprovidefunctionalstructuretotheprogram.Astatementinaprogramisabasicsentencethatexpressesasimpleidea—itspurposeistogivethecomputerabasicinstruction.Statementsdefinethetypesofdataallowed,howdataaretobemanipulated,andthewaysthatproceduresandfunctionswork.Programmersusestatementstomanipulatecommoncomponentsofprogramminglanguages,suchasvariablesandmacros(mini-programswithinaprogram).Statementsknownasdatadeclarationsgivenamesandpropertiestoelementsofaprogramcalledvariables.Variablescanbeassigneddifferentvalueswithintheprogram.Thepropertiesvariablescanhavearecalledtypes,andtheyincludesuchthingsaswhatpossiblevaluesmightbesavedinthevariables,howmuchnumericalaccuracyistobeusedinthevalues,andhowonevariablemayrepresentacollectionofsimplervaluesinanorganizedfashion,suchasatableorarray.Inmanyprogramminglanguages,akeydatatypeisapointer.Variablesthatarepointersdonotthemselveshavevalues;instead,theyhaveinformationthatthecomputercanusetolocatesomeothervariable—thatis,theypointtoanothervariable.Anexpressionisapieceofastatementthatdescribesaseriesofcomputationstobeperformedonsomeoftheprogram’svariables,suchasX+Y/Z,inwhichthevariablesareX,Y,andZandthecomputationsareadditionanddivision.Anassignmentstatementassignsavariableavaluederivedfromsomeexpression,whileconditionalstatementsspecifyexpressionstobetestedandthenusedtoselectwhichotherstatementsshouldbeexecutednext.

Procedureandfunctionstatementsdefinec

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2