大学英语期末复习TestBank1006_第1页
大学英语期末复习TestBank1006_第2页
大学英语期末复习TestBank1006_第3页
大学英语期末复习TestBank1006_第4页
大学英语期末复习TestBank1006_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

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

文档简介

1、大学英语期末复习TestBank1006大学英语期末复习TestBank1006大学英语期末复习TestBank1006TestBankChapterSix(ProgrammingLanguages)MultipleChoiceQuestions1.Whichofthefollowingisanexampleofalanguagethatisbasedonthefunctionalparadigm?D.C+ANSWER:A2.Whichofthefollowingisanexampleofalanguagethatisbasedontheobject-orientedparadigm?D.C+

2、ANSWER:D3.MostmachinelanguagesarebasedontheA.ImperativeparadigmB.DeclarativeparadigmANSWER:AWhichofthefollowingisnotatypeofstatementfoundinatypicalhigh-levelimperativeprogramminglanguage?ANSWER:B5.WhichofthefollowingdoesnotrequireaBooleanstructure?ANSWER:C6.Whichofthefollowingisnotacontrolstatement?

3、ANSWER:C7.Whichofthefollowingisnotacontrolstatement?ANSWER:C8.Whichofthefollowingisnotastepintheprocessoftranslatingaprogram?C.LexicalanalysisD.CodegenerationANSWER:A9.Whichofthefollowingisnotassociatedwithobject-orientedprogramming?ANSWER:B10.Whichofthefollowingisnotassociatedwiththeconceptofdataty

4、pe?ANSWER:C11.PositionswithinarraysareidentifiedbymeansofnumberscalledANSWER:A12.Whichofthefollowingisignoredbyacompiler?A.ControlstatementsB.DeclarationsofconstantsANSWER:D13.Whichofthefollowingisnotapossiblevalueoftheexpression4+62-1A.4B.5C.6D.10ANSWER:B14.Whichofthefollowingisnotawayofreferringto

5、avalueinaprogram?D.TypeANSWER:D15.Whichofthefollowingisthescopeofavariable?A.ThenumberofcharactersinthevariablesnameB.TheportionoftheprograminwhichthevariablecanbeaccessedC.ThetypeassociatedwiththevariableD.ThestructureassociatedwiththevariableANSWER:B16.Whichofthefollowingisameansofnullifyingconfli

6、ctsamongdatatypes?ANSWER:C17.Whichofthefollowingisnotconstructedbyatypicalcompiler?D.ObjectprogramANSWER:AWhichofthefollowingisameansofdefiningsimilaryetdifferentclassesinanobject-orientedprogram?ANSWER:A19.Whichofthefollowingisnotaparsetreeofanexpressionbasedonthefollowinggrammar?A.B.C.ANSWER:C20.W

7、hichofthefollowingstatementsisnotaresolventofthefollowingclauses?PORQORRPORTQORTRORRTORTD.QORTANSWER:BWhichofthefollowingcanPrologconcludefromthefollowingprogram?parent(jill,sue).parent(jill,sally).parent(john,sue).parent(john,sally).sibling(X,Y):-parent(Z,X),parent(Z,Y).A.parent(jill,john)B.sister(

8、sue,sally)C.sibling(sue,sally)D.sibling(jill,sue)ANSWER:CFill-in-the-blank/Short-answerQuestions1.Incontrastto_languagessuchasEnglishandSpanish,programminglanguagesareconsidered_languagesandarerigorouslydefinedbytheirgrammars.ANSWER:natural,formalListtwodisadvantagesofbothmachinelanguagesandassembly

9、languagesthatareovercomebyhigh-levelprogramminglanguages._ANSWER:Theyaremachinedependentandtheyrequirethatalgorithmsbeexpressedinsmallmachine-relatedstepsratherthatlargerapplication-orientedsteps.Indicatehoweachofthefollowingtypesofprogramminglanguagesisclassifiedintermsofgeneration(firstgeneration,

10、secondgeneration,orthirdgeneration).High-levellanguages_B.Machinelanguages_C.Assemblylanguages_C.SecondgenerationListfourdatatypesthatoccurasprimitivetypesinmanyhigh-levelprogramminglanguages._ANSWER:Possibleanswersinclude:integer,real(orfloat),Boolean,andcharacter.Whatencodingsystemiscommonlyusedto

11、encodedataofeachofthefollowingtypes?A.Integer_B.Real_C.Character_ANSWER:(CAUTION:Thisquestionreliesonmaterialfromchapter1)A.TwoscomplementFloating-pointASCIIorUnicodeA_arrayisanarrayinwhichallentriesareofthesametypewhereasentriesina_arraymaybeofdifferenttypes.ANSWER:homogeneous,heterogeneousInprogra

12、mminglanguagesthatuse+tomeanconcatenationofcharacterstrings,theexpression“2x”+“3x”willproducewhatresult?_ANSWER:“2x3x”8.Rewritethefollowinginstructionsusingasingleif-then-elsestatement.if(X=5)goto50goto6050printthevalueofZgoto100printthevalueofY.ANSWER:if(X=5)then(printthevalueofZ)else(printthevalue

13、ofY)9.Thefollowingisaprogramsegmentandthedefinitionofaprocedurenamedsub.X3;proceduresub(Y)sub(X);Y5;printthevalueofX;.A.Whatvaluewillbeprintedbytheprogramsegmentifparametersarepassedbyvalue?_B.Whatvaluewillbeprintedbytheprogramsegmentifparametersarepassedbyreference?_ANSWER:A.3B.510.Thefollowingisap

14、ceduresub.X8;.applyproceduresub;X2;printthevalueofX;.A.WhatvaluewillbeprintedbytheprogramsegmentifXisaglobalvariable?_B.WhatvaluewillbeprintedbytheprogramsegmentifXisadeclaredasalocalvariablewithintheprocedure?_ANSWER:A.8B.2Tosaythatagrammarisambi

15、guousmeansthat_.ANSWER:thegrammarallowsmorethanoneparsetreeforasinglestring12.Listthreeitemsofinformationthatwouldbecontainedinatypicalparserssymboltable._ANSWER:Possibleanswersinclude:namesofvariables,datatypesassociatedwithvariables,datastructuresassociatedwithvariables,andothers.Givethreeexamples

16、ofkeywordsthatareoftenfoundinhigh-levelimperativeorobject-orientedlanguages._ANSWER:Possibleanswersarenumerousandinclude:if,while,for,class,int,etc.14.Inadditiontotheproceduresname,whatotherinformationiscontainedtypicalprocedureinaheader?_ANSWER:Alistoftheformalparameters15.Inthecontextoftheobject-o

17、rientedparadigm,_aretemplatesfromwhich_areconstructed.Wesaythatthelatterisaninstanceoftheformer.ANSWER:classes,objectsInthecontextoftheobject-orientedparadigm,a_isanimperativeprogramunitthatdescribeshowanobjectshouldreacttoaparticularstimulus.ANSWER:method(ormemberfunctionforC+programmers)Basedonthe

18、sketchofaclassdefinitionbelow,whichmethodscanbeinvokedfromoutsideaninstanceoftheclass?classExamplepublicvoidmethod1().privatevoidmethod2().publicvoidmethod3()privatevoidmethod4()._ANSWER:method1andmethod318.WhatclausewouldproducetheresolventPORRORSwhenresolvedwiththeclausePORQ_ANSWER:QORRORSWhatgene

19、ralruleshouldbeaddedtothePrologprogrambelowsothatPrologcanconcludethaticecreamisbetterthanspinach?better(icecream,peanutbutter).better(peanutbutter,spinach)._ANSWER:Theequivalentof:better(X,Z):-better(X,Y),better(Y,Z).20.BasedonthePrologprogrambelow,whatgoalshouldbeusedtofindthesiblingsofsue?parent(

20、jill,sue).parent(jill,sally).parent(john,sue).parent(john,sally).sibling(X,Y):-parent(Z,X),parent(Z,Y)._ANSWER:Eithersibling(X,sue)orsibling(sue,X)Vocabulary(Matching)QuestionsThefollowingisalistoftermsfromthechapteralongwithdescriptivephrasesthatcanbeusedtoproducequestions(dependingonthetopicscover

21、edinyourcourse)inwhichthestudentsareasktomatchphrasesandterms.Anexamplewouldbeaquestionoftheform,ext“toIneachtheblankphrase,nwritethetermfromthefollowinglistthatisbestdescribedbythephrase.”TermDescriptivePhraseassemblylanguageAstepupfrommachinelanguageprogrammingparadigmAprogramdevelopmentmethodolog

22、ystructuredprogrammingAmethodologythatapplieswell-designedcontrolstructurestoproducewell-organizedsoftwaregrammarTherulesdefiningthesyntaxofaprogramminglanguageparsetreeA“pictorial”representationofthegrammaticalstructureofastringcompilerAprogramthattranslatesotherprogramsintomachinelanguageinterpret

23、erAprogramthatexecutesotherprogramswritteninahigh-levellanguagewithoutfirsttranslatingthemintomachinelanguagehigh-levellanguageAnotationalsystemforrepresentingalgorithmsinhumancompatibletermsratherthaninthedetailsofmachinerysemanticsMeaningasopposedtoappearancesyntaxAppearanceasopposedtomeaningopera

24、torprecedenceDictatestheorderinwhichoperationsareperformeddatastructureAconceptualorganizationofinformationparameterAmeansofpassinginformationtoaprocedureorfunctiondatatypeEncompassesbothanencodingsystemandacollectionofoperationssyntaxdiagramsAwayofrepresentingagrammarsourceprogramAprogramexpressedi

25、nahigh-levellanguageGeneralFormatQuestions1.Whatdoesitmeantosaythataprogramminglanguageismachineindependent?ANSWER:Itmeansthatprogramswritteninthelanguagedonotrefertopropertiesofaspecificmachineandarethereforecompatiblewithanycomputer.2.Explainthedistinctionbetweentheimperativeanddeclarativeprogramm

26、ingparadigms.ANSWER:Theimperativeparadigmrequiresthataprogrammerdescribeanalgorithmforsolvingtheproblemathand.Thedeclarativeparadigmrequiresthattheprogrammerdescribetheproblem.Explainwhythegenerationapproachtoclassifyingprogramminglanguagesfailstocapturethefullscopeoftodayslanguages.ANSWER:Thegenera

27、tionapproachfailstoreflectthearrayofdistinctprogrammingparadigms.Explainthedistinctionbetweentranslatingaprogram(inahigh-levellanguage)andinterpretingtheprogram.ANSWER:Totranslateaprogramistoconvertittoanother(usuallylow-level)languagewithoutexecutingit.Tointerpretaprogramistoexecuteitdirectlyfromit

28、shigh-levellanguageform.5.Whyisthestraightforward“goto”statementnolongerpopular-levelprogramminghighlanguages?ANSWER:Itsuseledtopoorlystructuredprogramsthatwerehardtounderstand.6.Explainthedistinctionbetweenaformalparameterandanactualparameter.ANSWER:Aformalparameterisatermusedinasubprogramunittoref

29、ertodatathatwillbegiventothesubprogramwhenitisexecuted.Anactualparameteristhedatathatisgiventothesubprogramunitwhenitisexecuted.(Aformalparameterisa“placeholder”thatis“filledin”withanactualparameterwhensubprogramunitisexecuted.)7.Explainthedistinctionbetweenglobalandlocalvariables.ANSWER:Aglobalvariableisreadilyaccessiblethroughouttheprogramwhereasalocalvariableisaccessibleonlywithinaspecificarea.8.Explainthedistinctionbetweenaprocedureandafunction.ANSWER:Aprocedurereturnsvaluesviaparametersandglobalvariableswhereasafunctionr

温馨提示

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

评论

0/150

提交评论