SSD5单选.docx

上传人:b****4 文档编号:3002673 上传时间:2022-11-17 格式:DOCX 页数:43 大小:97.76KB
下载 相关 举报
SSD5单选.docx_第1页
第1页 / 共43页
SSD5单选.docx_第2页
第2页 / 共43页
SSD5单选.docx_第3页
第3页 / 共43页
SSD5单选.docx_第4页
第4页 / 共43页
SSD5单选.docx_第5页
第5页 / 共43页
点击查看更多>>
下载资源
资源描述

SSD5单选.docx

《SSD5单选.docx》由会员分享,可在线阅读,更多相关《SSD5单选.docx(43页珍藏版)》请在冰豆网上搜索。

SSD5单选.docx

SSD5单选

1.1.1

1.C++issaidtobeanobject-orientedlanguagebecauseofitssupportfor(b)

(a)C-stylecomments

(b)classes,inheritance,andpolymorphism

(c)attendantalgorithms

(d)pointers

2.WhichofthefollowingstatementsaboutC++is(are)true(c)

Itisstronglytyped.

IthasbeenstandardizedbyISO.

(a)None

(b)Ionly

(c)IandII

(d)IIonly

1.1.2

1.AllofthefollowingcharactersareallowedtobepartofavalidC++identifierexcept(a)

(a)-(hyphen)

(b)_(underscore)

(c)X

(d)3

2.Toproduceanexecutableimage,aC++sourcefilemustbe_____,then_____,andfinally_____.(c)

(a)linked,preprocessed,compiled

(b)compiled,preprocessed,linked

(c)preprocessed,compiled,linked

(d)compiled,linked,preprocessed

3.Attheendofthe_____stageforaC++program,a(n)_____canbeproduced.(c)

(a)linking,sourcefile

(b)preprocessing,objectfile

(c)linking,executableimage

(d)compiling,preprocessedfile

4.InC++,thedirective#includeisprocessedbythe(a)

(a)preprocessor

(b)StandardTemplateLibrary

(c)linker

(d)compiler

1.2.1

1.Linesatastore,filecabinets,andbookcasesarereal-worldentitiesthatmostresemble_____incomputerscience.(a)

(a)datastructures

(b)functionalprogramminglanguages

(c)algorithms

(d)object-orientedprogramminglanguages

2.Incomputerscience,astructuredrepresentationofinformationisknownasa(n)(b)

(a)cache

(b)datastructure

(c)algorithm

(d)processor

3.Anorderedsetofdirectivesthatcanbecarriedoutmechanicallyisknownasa(n)(b)

(a)hashtable

(b)algorithm

(c)associativearray

(d)tree

1.2.2

1.Decompositionofaprobleminvolveswhichofthefollowing?

(d)

(a)Simplifyingtheproblembyeliminatinglow-priorityrequirements

(b)Determiningaprogramminglanguageforimplementingasolutiontotheproblem

(c)Reverse-engineeringanalgorithmthatsolvesadifferentproblem

(d)Identifyingentitiesandrelationshipsthatwillaidinsolvingtheproblem

1.3.1

1.WhichofthefollowingexpressionsevaluatestotrueinC++ifandonlyiftheindexvariableiisinboundsforanarrayofsize10?

(c)

(a)0<10

(b)0<=i&&i<=10

(c)0<=i&&i<10

(d)0<=i<10

2.WhichofthefollowinglistsofC++typesareorderedincreasinglybysize,ascomputedbysizeof()?

(d)

(a)short,char,int,long

(b)long,int,short,char

(c)long,int,char,short

(d)char,short,int,long

3.EachofthefollowingisabasicC++typeexcept(c)

(a)bool

(b)char

(c)byte

(d)unsignedint

1.3.2

1.Thepurposeoftheassignmentoperatoristo(b)

(a)beusedinternallyinanobject'scopyconstructor

(b)provideforproperassignmentbetweenobjects

(c)initializedatamemberswhenaninstanceisfirstcreated

(d)preventmemoryleaks

2.Ifauser-definedclassComplexhasoverloadedoperator+=,thenonewouldexpectthisoperatortohavewhichofthefollowingdeclarations?

(c)

(a)voidoperator+=(constComplex&rhs);

(b)voidoperator+=(floatreal,floatimag);

(c)Complex&operator+=(constComplex&rhs);

(d)Complex&operator+=(constComplexrhs);

3.AssumethatThingisauser-definedclass,andconsiderthefollowingcodefragment,whereBisaninstanceofThing.

ThingA=B;

Whichofthefollowingisaclassmemberthatisusedinthiscodefragment?

(c)

(a)Theassignmentoperator

(b)Thedefaultconstructor

(c)Thecopyconstructor

(d)Thedestructor

4.AssumethatThingisauser-definedclass,andconsiderthefollowingfunction.

Thingf(Thing&A){

ThingB;

B.x=A.x;

returnB;

}

Whereinthiscodewillacopyconstructorbeused?

(b)

(a)IncopyingthedatafromAtoB

(b)Inthereturnoperation

(c)Inpassingtheparameter

(d)InthecreationofthelocalvariableB

5.Whichofthefollowingistrueaboutaclasswithouta(user-defined)constructor?

(a)

(a)Itmayhaveadestructor,butmightnot.

(b)Itcannothaveadestructor.

(c)Itmusthaveadestructor.

(d)Itcannothaveanassignmentoperator.

6.InaC++class,accesstodatamembersandfunctionmembersaretypically(b)

(a)bothprivate

(b)privateandpublic,respectively

(c)publicandprivate,respectively

(d)bothpublic

7.Towhichofthefollowingisobject-basedprogrammingideallysuited?

(b)

(a)Implementingsimplemonolithicprograms

(b)Encapsulation

(c)Attainingthehighestpossibleefficiency

(d)Providingelegantmechanismsforcodereuse

1.3.3

1.RegardingC++standardI/O,the_____operatorwritestoastreamandthe_____operatorreadsfromastream.(d)

(a)>,<

(b)>>,<<

(c)<,>

(d)<<,>>

2.Supposeinfisanavailableifstreamandcisanavailablecharacter.Considerthefollowingcodefragment.

do

c=inf.get();

while(!

inf.eof()&&isspace(c));

Whichofthefollowi

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1