ssd6选择题答案无重复

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1.ConsiderthefollowingfragmentofC++sourcecode.Stringmsg;unsignedintx;inty;cinmsgxy;coutx+y;Whichofthefollowingis(are)trueregardingexecutionofthesegment?Theinputstatementwillalwaystakethesameamountoftimetoexecute.Theoutputstatementwillalwaysbeexecutedimmediatelyaftertheinputstatement.Ifxandyarebothpositive,anintegergreaterthanbothwillbeprinted.(a)IIonly(b)none(c)IandIIonly(d)IIandIIIonlyCorrectansweris(b)Seesection1.1.1ofthecoursenotes.--------------------------------------------------------------------------------2.Integratedprogrammingenvironmentsmakeitdifficulttomixandmatchtoolsfromdifferentsources.Thisis(a)bad,becausenosinglevendorislikelytobethesourceofallthebesttools(b)good,becauseitensurescompilationisnotdoneincrementallybyaccident(c)bad,becauseallthetoolswillthenhavethesameuserinterface(d)good,becausetoolsfromdifferentsourcescannotbemadetointeractwitheachotherCorrectansweris(a)Seesection1.1.4ofthecoursenotes.--------------------------------------------------------------------------------3.InVisualC++,aWin32ConsoleApplicationis(a)aprogramthatisabletocontroltheoperatingsystemofawindowscomputer(b)thesimplesttypeofapplicationVisualC++cangenerate(c)thestatuswindowoftheVisualC++environment(d)builtbyusingsophisticatedApplicationWizardsCorrectansweris(b)Seesection1.2.1ofthecoursenotes.4.WhichofthefollowingmustbetrueifaprogramisstoppedataspecificlinewithintheVisualC++debugger?Thereisatleastonebreakpointenabled.Thereisabreakpointenabledonthatline.Thereisabreakpointenabledonthelineprecedingthatline.(a)IandIIIonly(b)IandIIonly(c)none(d)IonlyCorrectansweris(c)5.Whatdoesthefollowingprogramprint?voidcallee(int*count){(*count)++;}intmain(intargc,char*argv[]){intcount=4;callee(count);printf(%d,count);return0;}(a)8(b)nothing:itwillnotcompilesuccessfully(c)4(d)5Correctansweris(b)Seesection1.4.1ofthecoursenotes.6.Considerthefollowingprogram.inti;int*jp=&i;intmain(inti,char*argv[]){printf(%d%d\n,(int)&i,(int)jp);//随机值i,与局部值i不一样}Whichofthefollowingdescribeswhatitprints?(a)twovalues,one4greaterthantheother(b)twoverydifferentintegers(c)nothing:itwillnotcompilebecauseitisambiguous(d)twointegersthatareexactlythesameCorrectansweris(b)--------------------------------------------------------------------------------xxx7.Activationrecordsareorganizedinstacksbecause(a)stacksallowactivationrecordstobepushedandpoppedinanyorder.(b)functionsneedtoaccessallthevariablesofthefunctionsthatcallthem.(c)theyareseldomneededduringprogramexecution.(d)stacksaresimpleenoughforthehardwaretomanage.Correctansweris(d)8.Whatdoesthefollowingprogramprint?intcallee(int*count){count++;return*count;}intmain(intargc,char*argv[]){intcount=4;intretval;retval=callee(&count);printf(%d,retval);return0;}(a)5(b)cannotbedeterminedfromtheinformationgiven.(c)4(d)8Correctansweris(b)9.ConsiderthefollowingsegmentofCsourcecode.inta=8;intb=*&a;Whatisthevalueofvariablebattheendofexecutionofthesegment?(a)(int)&b(b)&a(c)(int)&a(d)aCorrectansweris(d)xxx10.ConsiderthefollowingsegmentofaCprogram.inti=99;inta[100];i=a[i+1];Whichofthefollowingistrueofthesegment?(a)Whenexecuted,theprogramwillbeprematurelyterminatedbytheoperatingsystembecauseofanillegalmemoryaccess.(b)iwillhavethevalueofthelastelementofthearrayaattheendofanyexecutionofthesegment.(c)Executionwillfailbecauseahasthewrongsize.(d)iwillhavethevalue99attheendofanyexecutionofthesegment.Correctansweris(d)xxx11.Abranchinstruction(a)setstheprogramcountertooneoftwopossiblevalues(b)setstheprogramcountertooneofmanypossiblevalues(c)increasestheprogramcounterbyafixedamount(d)unconditionallysetstheprogramcountertoitsoperandCorrectansweris(a)xxx12.Whichofthefollowingisagoodreason(aregoodreasons)toequiptheCPUwithsmallamountsoffastmemory?//这里指CPU里的寄存器TomakethedesignofthecompilersimplerTomakesomeCPUinstructionssmallerTomakesomeCPUinstructionsfaster(a)IIIonly(b)IIandIIIonly(c)I,II,andIII(d)IIonlyCorrectansweris(b)13.Supposethat,usingatoolsuchasthememorywindowofVisualC++,wefoundthatacertainsetofcontiguousmemorylocationscontainedtheinteger0xC605CD623A8365000000.Whatcouldthesememorylocationshold?theinteger0xC605CD623A8365000000astringaCPUinstruction(a)I,II,andIII(b)IIIonly(c)IandIIonly(d)IonlyCorrectansweris(a)14.WhichofthefollowingcomputationsmaybeperformedbyexactlyoneCPUinstruction?a=5;//直接用MOV语句就可以了a=b+c*5;for(i=0;i10;i+=a[i++]);(a)IandIIonly(b)Ionly(c)I,II,andIII(d)IIonlyCorrectansweris(b)1.WhichofthefollowingVisualC++objectsarecontainedwithinaProject?FilesVisualC++SolutionsFlowcharts(a)IIandIIIonly(b)IIonly(c)I,IIandIII(d)IonlyCorrectansweris(d)xxx2.Whichofthefollowingdoesadebuggerdo?//debug状态程序语法没错,语义有错,要程序员自己调出来Analyzethesourcecodetofindprogrammingerrors.Decodemachinecodegeneratedbyacompiler.Stopexecutionofaprogram.(a)IIandIIIonly(b)IandIIIonly(c)I,II,andIII.(d)IIIonlyCorrectansweris(a)--------------------------------------------------------------------------------4.WithinVisualC++,whichofthefollowingwillrevealthevalueofavariablewhentheprogramisstoppedatabreakpoint?Placingthemousepointeroverthevariablenameinthesourcefilewind

1 / 22
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功