您好,欢迎访问三七文档
当前位置:首页 > 幼儿/小学教育 > 小学教育 > ssd6选择题(已经尽量去重了)
AssessmentName:Multiple-ChoiceQuiz11.WhichofthefollowingVisualC++objectsarecontainedwithinaProject?I.FilesII.VisualC++SolutionsIII.Flowcharts(b)I,IIandIII(c)Ionly(d)IIandIIIonlyCorrectansweris(c)2.Integratedprogrammingenvironmentsmakeitdifficulttomixandmatchtoolsfromdifferentsources.Thisis(a)good,becausetoolsfromdifferentsourcescannotbemadetointeractwitheachother(b)good,becauseitensurescompilationisnotdoneincrementallybyaccident(c)bad,becauseallthetoolswillthenhavethesameuserinterface(d)bad,becausenosinglevendorislikelytobethesourceofallthebesttoolsCorrectansweris(d)3.WhendebuggingusingVisualC++,whichofthefollowingarepossiblethroughtheWatchwindow?I.Theprogram'sexecutioncanbestopped.II.ThevalueofanarbitraryCexpressioncanbecalculated.III.Thevalueofaprogramvariablecanbeset.(a)IIonly(b)IIandIIIonly(c)IIIonly(d)I,II,andIII.Correctansweris(b)4.Whenusingadebuggertofindthecauseofaprogram'sincorrectbehavior,(a)itisoftennecessarytostarttheprogrammultipletimesunderthedebugger(b)theprogramisusuallyexecutedtothepointatwhichthebehavioroccursandthenexecutedbackwardstofindthecause(c)itisfastesttostartbystoppingthedebuggerlongbeforethebehaviorappears(d)thefaultycodefragmentmustfirstbeidentifiedCorrectansweris(a)5.Considerthefollowingprogram.inti;int*jp=&i;intmain(inti,char*argv[]){printf(%d%d\n,(int)&i,(int)jp);}Whichofthefollowingdescribeswhatitprints?(a)nothing:itwillnotcompilebecauseitisambiguous(b)twointegersthatareexactlythesame(c)twoverydifferentintegers(d)twovalues,one4greaterthantheotherCorrectansweris(c)6.Whatisprintedasaresultofexecutionofthefollowingprogram?#includestdio.hvoidcallee(int*count){(*count)++;}intmain(intargc,char*argv[]){intcount=4;callee(&count);printf(%d,count);return0;}(a)4(b)Itcannotbedeterminedfromtheinformationgiven.(c)8(d)5Correctansweris(d)7.(注意与6的区别)Whatdoesthefollowingprogramprint?voidcallee(int*count){(*count)++;}intmain(intargc,char*argv[]){intcount=4;callee(count);printf(%d,count);return0;}(a)5(b)nothing:itwillnotcompilesuccessfully(c)8(d)4Correctansweris(b)8.Considerthefollowingprogram.inti;intj=1;intcallee(intnumber){intplusone;plusone=number+1;returnplusone;}intmain(intargc,char*argv[]){if(j==1)returncallee(i);returnj;}Whichofthefollowingareallocatedintheactivationrecordimmediatelyafterthefunctioncallee()isinvoked?(a)plusoneandnumberonly.(b)ionly.(c)plusoneonly.(d)i,jandnumberonly.Correctansweris(a)9.TheVisualC++Memorywindowdisplays(a)thecontentsofmemory,interpretedas32-bitintegers,withouttheassociatedvariablenames(b)thenamesandvaluesofvariablesinmemory,interpretedas32-bitintegersnomatterwhatthevariables'types(c)thecontentsofmemory,interpretedinoneofseveralways,withouttheassociatedvariablenames(d)thenamesandvaluesofvariablesinmemory,interpretedinoneofseveralwaysCorrectansweris(c)10.Inacomputerinwhichbothaddressesandintegersare32bitswide,howmanybytesofmemorywillthecompilerallocateforfollowingcodefragment?inta;int*b=&a;(a)32(b)4(c)0(d)8Correctansweris(d)11.Whichofthefollowingaretrueoftheeffectthatoptimizationshaveonthemachinecodegeneratedbycompilers?I.Theresultingcodewillbefasterand/orsmaller.II.Theresultingcodewillbeclearer.III.Theresultingcodewillbehardertodebug.(a)IandIIonly(b)Ionly(c)I,II,andIII(d)IandIIIonlyCorrectansweris(d)12.WhichofthefollowingcomputationsmaybeperformedbyexactlyoneCPUinstruction?I.a=5;II.a=b+c*5;III.for(i=0;i10;i+=a[i++]);(a)I,II,andIII(b)Ionly(c)IIonly(d)IandIIonlyCorrectansweris(b)13.ProgramscompiledforanIntelPentiumprocessordonotexecuteproperlyonaSPARCprocessorfromSunMicrosystemsbecause(a)thememoryofaSPARCCPUisnumberedfromtoptobottom(b)theoperationcodesunderstoodbythetwoprocessorsaredifferent(c)theassemblymnemonicsforthesameopcodearedifferentinthetwoprocessors(d)copyrightsregardingcodecannotbeviolatedCorrectansweris(b)14.Considerthefollowingpseudo-instructions.0x40B7D8i=i-10x40B7E0branch-if-not-zero0x40B7D8Whichofthefollowingcodefragmentsdotheinstructionsencode?I.if(i!=0)i=i-1;II.while(--i);III.do{i=i-1;}while(i);(a)Ionly(b)IIandIIIonly(c)IIIonly(d)IIonlyCorrectansweris(b)15.Whichofthefollowingdoesadebuggerdo?I.Analyzethesourcecodetofindprogrammingerrors.II.Decodemachinecodegeneratedbyacompiler.III.Stopexecutionofaprogram.(a)I,II,andIII.(b)IandIIIonly(c)IIIonly(d)IIandIIIonlyCorrectansweris(d)16.Themachinecodegeneratedfromsourcecodebyacompiler(a)executesmorequicklythanthesourcecode(b)doesnotpreservealltheinformationgiveninthesourcecode(c)associatesvariablevalueswiththeirnames(d)canbeeasilyinspectedtocheckthecorrectnessofthecompilerCorrectansweris(b)17.InVisualC++,aWin32ConsoleApplicationis(a)thestatuswindowoftheVisualC++environment(b)aprogramthatisabletocontroltheoperatingsystemofawindowscomputer(c)builtbyusingsophisticatedApplicationWizards(d)thesimplesttypeofapplicationVisualC++cangenerateCorrectansweris(d)18.Considerthefunctionfactorial()definedasfollows.intfactorial(intn){if(n==1)returnn;returnn*factorial(n-1);}Howmanyactivationrecordsoffactorialareallocatedbyinvocationoftheexpressionfactorial(4)?(a)0(b)1(c)4(d)5Correctansweris(c)19.Activationrecordsar
本文标题:ssd6选择题(已经尽量去重了)
链接地址:https://www.777doc.com/doc-6951952 .html