系统级编程选择题.docx
- 文档编号:5452419
- 上传时间:2022-12-16
- 格式:DOCX
- 页数:40
- 大小:33.71KB
系统级编程选择题.docx
《系统级编程选择题.docx》由会员分享,可在线阅读,更多相关《系统级编程选择题.docx(40页珍藏版)》请在冰豆网上搜索。
系统级编程选择题
MultipleChoiceQuiz1
1.WhichofthefollowingVisualC++objectsarecontainedwithina"Project"?
(a)
I.FilesII.VisualC++SolutionsIII.Flowcharts
a.Ionly
b.I,IIandIII
c.IIonly
d.IIandIIIonly
2.InVisualC++,aWin32ConsoleApplicationis(d)
a.thestatuswindowoftheVisualC++environment
b.builtbyusingsophisticated"ApplicationWizards"
c.aprogramthatisabletocontroltheoperatingsystemofawindowscomputer
d.thesimplesttypeofapplicationVisualC++cangenerate
3.Whichofthefollowingisabletodescribeacomputationatthehighestlevelofabstraction?
(a)
a.C++code
b.logicGates
c.machinecode
d.Ccode
4.ConsiderthefollowingfragmentofC++sourcecode.(c)
Stringmsg;unsignedintx;inty;
cin>>msg>>x>>y;
cout< Whichofthefollowingis(are)trueregardingexecutionofthesegment? 1.Theinputstatementwillalwaystakethesameamountoftimetoexecute. 2.Theoutputstatementwillalwaysbeexecutedimmediatelyaftertheinputstatement. 3.Ifxandyarebothpositive,anintegergreaterthanbothwillbeprinted. a.IIandIIIonly b.IandIIonly c.none d.IIonly 5.Integratedprogrammingenvironmentsmakeitdifficulttomixandmatchtoolsfromdifferentsources.Thisis(b) a.good,becausetoolsfromdifferentsourcescannotbemadetointeractwitheachother b.bad,becausenosinglevendorislikelytobethesourceofallthebesttools c.bad,becauseallthetoolswillthenhavethesameuserinterface d.good,becauseitensurescompilationisnotdoneincrementallybyaccident 6.Comparedtoasequenceofmachinecodeinstructions,afragmentofCcode(a) a.maydescribethesamealgorithm b.isthenativewaytoprogrammostcomputers c.describestheactionsofthecomputer,notjustoftheCPU d.doesnotengageanytransistorsduringitsexecution 7.Whichofthefollowingdoesadebuggerdo? (c) 1.Analyzethesourcecodetofindprogrammingerrors. 2.Decodemachinecodegeneratedbyacompiler. 3.Stopexecutionofaprogram. a.I,II,andIII. b.IandIIIonly c.IIandIIIonly d.IIIonly 8.Whenusingadebuggertofindthecauseofaprogram'sincorrectbehavior,(a) a.itisoftennecessarytostarttheprogrammultipletimesunderthedebugger b.thefaultycodefragmentmustfirstbeidentified c.theprogramisusuallyexecutedtothepointatwhichthebehavioroccursandthenexecutedbackwardstofindthecause d.itisfastesttostartbystoppingthedebuggerlongbeforethebehaviorappears MultipleChoiceQuiz2 1.Inacomputerwith4-bytewords,whichofthefollowingCexpressionstestswhetherptrcontainstheaddressofaword? (c) I.(ptr&3)==0 II.(ptr|3)==0 III.(ptr%4)==0 a.IIIonly b.Ionly c.IandIIIonly d.IIonly 2.WhathappensinaCprogramwhenanadditionwouldcauseintegeroverflow? (a) a.Anincorrectresultisproducedandexecutioncontinues. b.Anexception-handleriscalledwiththetwooperandsasparameters. c.Executionisterminated. d.Thecorrectvalueiscoercedtoafloatingpointnumber. 3.InC,whatisthefollowingbinarynumberinhexadecimal? (a) 11010101 a.0xD5 b.0x5D c.0xB5 d.0xAB 4.Whatisthepurposeoftheexponentinfloatingpointnumbers? (c) a.tospecifythebaseasbinary,octal,orhexadecimal b.themantissaisraisedtothepoweroftheexponent c.toindicatewherethedecimalorbinarypointshouldbe d.tospecifythesuperscript 5.Howis-10(decimal)representedinan8-bit2'scomplementbinaryformat? (a) a.11110110 b.11110101 c.10001010 d.11111010 6.InC,usingdefaultfloatingpointsettings,whathappenswhenafloating-pointcomputationresultsinanoverflow? (c) a.Anerroneousvalueiscomputedandexecutioncontinues. b.Programexecutionishalted. c.Aspecialvalue"infinity"iscomputed,testablewith_finite(). d.Anexceptionisraisedunlessdisabledbycalling_controlfp(). 7.WhatisthevalueofthefollowingCexpression? (c) 0x1234&0x5432 a.0x1111 b.0x6666 c.0x1030 d.0x5636 8.Whichofthefollowingnumericaloperationsismostlikelytoleadtolossofprecision? (c) a.Floating-pointmultiplication b.Integeraddition c.Floating-pointaddition d.Integermultiplication 9.Whichofthefollowingcouldberepresentedbyonebitofinformation? (c) a.thecolorofasinglepixelonatrue-colorcomputerdisplay b.anASCIIcharacter c.thepositionofalightswitch d.thecurrentchannelofatelevisionreceiver 10.Whichofthefollowingstatementsaboutfloating-pointnumbersinCistrue? (a) I.Floating-pointnumbersareoftenonlyapproximationsofrealnumbers. II.A32-bitfloatonlyapproximatesdecimalfractions,buta64-bitdoublerepresentsthemexactly. III.Floating-pointnumberscanrepresentanyrationalrealnumberbutnotirrationals. a.Ionly b.IandIIIonly c.IIonly d.IandIIonly 11.Howis46(decimal)representedinan8-bit2'scomplementbinaryformat? (a) a.00101110 b.01000110 c.00011110 d.00101100 12.WhatisthevalueofthefollowingCexpression? (d) 0x1234^0x5432(这是XOR运算) a.0x1030 b.0x5434 c.0x5636 d.0x4606 MultipleChoiceQuiz3 1: Theprogramcountercontains(D) a.thenumberofCPUinstructionsaprogramhasexecutedsofar b.thenumberoftimesaprogramhasbeenexecuted c.theamountofmemoryaprogramiscurrentlyusing d.theaddressoftheCPUinstructionthatisabouttobefetched 2: Whichofthefollowingisagoodreason(aregoodreasons)toequiptheCPUwithsmallamountsoffastmemory? (a) I.Tomakethedesignofthecompilersimpler II.TomakesomeCPUinstructionssmaller III.TomakesomeCPUinstructionsfaster a.IIandIIIonly b.I,II,andIII c.IIIonly d.IIonly 3.WhichofthefollowingmustbetrueifaprogramisstoppedataspecificlinewithintheVisualC++debugger? (D) I.Thereisatleastonebreakpointenabled. II.Thereisabreakpointenabledonthatline. III.Thereisabreakpointenabledonthelineprecedingthatline. a.Ionly b.IandIIonly c.IandIIIonly d.none 4: ProgramscompiledforanIntelPentiumprocessordonotexecuteproperlyon aSPARCprocessorfromSunMicrosystemsbecause(B) a.copyrightsregardingcodecannotbeviolated b.theoperationcodesunderstoodbythetwoprocessorsaredifferent c.theassemblymnemonicsforthesame"opcode"aredifferentinthetwoprocessors d.thememoryofaSPARCCPUisnumberedfromtoptobottom 5: WithinVisualC++,whichofthefollowingwillrevealthevalueofvariablewhentheprogramisstoppedatabreakpoint? (B) I.Placingthemousepointeroverthevariablenameinthesourcefilewindow. II.Insertingaprintf()intheprogram. III.Typingthevariablenameonthe"Watch"window. a.IIIonly b.IandIIIonly c.I,II,andIII d.IIandIIIonly 6: ImmediatelyaftertheCPUexecutesaninstructionthatisneitherabranch norajumpinstruction,theprogramcounter(B) a.remainsunchanged b.isincrementedtopointtothefollowinginstruction c.hasavaluethatcannotbedeterminedwithoutfurtherinformation d.isincrementedbyone 7: ACPUregisterisawordofCPUmemorythat(C) a.housesacriticalvariableforthedurationoftheexecutionofaprogram b.recordstheresultsofperiodicCPUdiagnostics c.isexplicitlyloadedandunloadedfromnormalmemorybycompiler-generatedinstructions d.isautomaticallyloadedwhenaCPUinstructionreferstoawordofnormalmemory 8: WhichofthefollowingcomputationsmaybeperformedbyexactlyoneCPUinstruction? (A) 1.a=5; 2.a=b+c*5; 3.for(i=0;i<10;i+=a[i++]); a.Ionly b.IIonly c.I,II,andIII d.IandIIonly 9: Supposethat,usingatoolsuchasthememorywindowofVisualC++,wefoundthatacertainsetofcontiguousmemorylocationscontainedtheinteger0xC605CD623A8365000000.Whatcouldthesememorylocationshold? (D) 1.theinteger0xC605CD623A8365000000 2.astring 3.aCPUinstruction a.Ionly b.IIIonly c.IandIIonly d.I,II,andIII 10: Abranchinstruction(A) a.setstheprogramcountertooneoftwopossiblevalues b.increasestheprogramcounterbyafixedamount c.setstheprogramcountertooneofmanypossiblevalues d.unconditionallysetstheprogramcountertoitsoperand 11: Ajumpinstruction(D) a.changestheprogramcounteronlyifitsoperandisequaltozero b.changesapointertopointtothenextelementofanarray c.increasestheprogramcounter d.unconditionallysetstheprogramcountertoitsoperand 12: Themachinecodegeneratedfromsourcecodebyacompiler(C) a.associatesvariablevalueswiththeirnames b.executesmorequicklythanthesourcecode c.doesnotpreservealltheinformationgiveninthesourcecode d.canbeeasilyinspectedtocheckthecorrectnessofthecompiler 13: Whichofthefollowingaretrueoftheeffectthatoptimizationshaveonthemachinecodegeneratedbycompilers? (B) I.Theresultingcodewillbefasterand/orsmaller. II.Theresultingcodewillbeclearer. III.Theresultingcodewillbehardertodebug. a.I,II,andIII b.IandIIIonly c.IandIIonly d.Ionly MultipleChoiceQuiz4 1: InC,assumingthataninttakes4bytes,ifarrayaisdec
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 系统 编程 选择题
![提示](https://static.bdocx.com/images/bang_tan.gif)