版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025版成都事业单位劳动合同范本(含劳动合同签订及备案要求)3篇
- 2024年药理学研究员岗位协议3篇
- 2025版开发商与二手房买家房屋置换及装修服务合同3篇
- 建筑物给排水安全合同
- 野营基地建设合同进度跟踪
- 公共设施维护招标实施细则
- 2024年铁路客运特许经营合同3篇
- 物流信贷证明业务
- 保定市河道水利工程规划
- 婚礼场地租赁合同违约
- 新概念英语第一册Lesson-67-68练习题
- 2024年杭州市能源集团招聘笔试参考题库含答案解析
- 产科利用PDCA循环降低初产妇阴道分娩会阴侧切率品管圈QCC成果汇报
- 2024届黑龙江省齐齐哈尔市建华区中考联考数学试题含解析
- 企业融资尽调报告
- 2023年我国及部分省市畜牧业相关政策 深入推进草原畜牧业转型升级
- 小学六年级语文:《常考的10篇文言文》
- DB31∕T 1154-2019 手术室X射线影像诊断放射防护及检测要求
- 花岗岩检测报告-实用文档
- 保育员(高级)考试题库附答案(600题)
- 中国铝业股份有限公司河南分公司巩义市山川铝土矿矿山地质环境保护与土地复垦方案
评论
0/150
提交评论