2012-2013(一)ssd3考试试卷B.docx

上传人:p** 文档编号:824628 上传时间:2024-03-15 格式:DOCX 页数:7 大小:71.88KB
下载 相关 举报
2012-2013(一)ssd3考试试卷B.docx_第1页
第1页 / 共7页
2012-2013(一)ssd3考试试卷B.docx_第2页
第2页 / 共7页
2012-2013(一)ssd3考试试卷B.docx_第3页
第3页 / 共7页
2012-2013(一)ssd3考试试卷B.docx_第4页
第4页 / 共7页
2012-2013(一)ssd3考试试卷B.docx_第5页
第5页 / 共7页
2012-2013(一)ssd3考试试卷B.docx_第6页
第6页 / 共7页
2012-2013(一)ssd3考试试卷B.docx_第7页
第7页 / 共7页
亲,该文档总共7页,全部预览完了,如果喜欢就下载吧!
资源描述

《2012-2013(一)ssd3考试试卷B.docx》由会员分享,可在线阅读,更多相关《2012-2013(一)ssd3考试试卷B.docx(7页珍藏版)》请在第壹文秘上搜索。

1、总分四五东北大学考试试卷(B卷)20122013学年第一学期课程名称:面向对象程序设计II.SingleChoice(20points,2pointeach)IConsiderthefollowingJavaprogramsegment.()intx=5;inty=2;System.out.println(x+y);(A) Theoutputcausedbythecodewillbe512.(B) Theoutputcausedbythecodewillbe512.(C) TheoutputcausedbythecodewillbeH.(D) Thecodewillcauseampilatio

2、nerror.2UMLclassdiagramscandescribewhichofthefollowing?()I. TheinternalstructureofclassesII. Relationshipsbetweenclasses(八)11only(B)Ionly(C)IandIl(D)None3WhenasubclassdefinesaninstancemethodwiththeSalnereturn(yeandsignatureasaInelhodinitsparent,theparentsmethodissaidtobe:()(八)overridden(B)overloaded

3、(C)private(D)hidden4Anobjectthatcontainsnwthodsthattraverseacollectionlinearlyfromstart(ofinishisknownasa(n)(八)loop(B)in(C)iterator(D)Exception5 WhichofthefollowingistrueaboutassociationandaggregationinUMLclassdiagrams?(A) Associationandaggregationhavenomeaningfulrelationship.(B) Associationisaspeci

4、alformofaggregation.(C) Associationistheoppositeofaggregation.(D) Aggregationisaspecialformofassociation.6 Inanobjectnxiel.thedatathatanobjectisresponsibleformaintainingarerepresentedby(八)generalizations(B)attributes(C)methods(D)SPCCialiZat沁ns7 Whenusingnoun-phraseanalysistomodelasoftwaresystem,whic

5、hofthefollowingshouldtypicallybeeliminatedfromthelistofpotentialclasses?()I. Referencesto(hesoftwaresystemitselfII. Nouns(hatimplyrolesbetweenobjectsIII. Synonymstoothernounsinthelist(八)Iand111only(B)111only(C)I,ILand111(D)11and111only8WhaiistherightwaytohandleabnormalitiesininputonJava?()(A) Byalwa

6、ysspecifyingthethrowsclauseineverymethodheaderwherefileI/Oisperformed(B) ByusingtheclassEiIeFiIterwhichgracefullyfiltersoutbadinputdata(C) Byhandlingtheseproblemsbyprovidingexceptionhandlers(D) Bywritingwhileloopstoguardagainstbadinput9Acomponentcanberesizedhorizontally,butnotvertically,whenitisplac

7、esinwhichregionofaBorderLayout?()(八)NorthorSouth(B)EastorWest(C)Center(D)North.SouthorCenterIOWhichofthefollowingistrueregardingIhecontrollerpartintheModel-fiew-Cvninzller(MVC)paradigm?()(A) ,hecontrolleristheabstractdomainknowledgeofanapplication.(B) ThecontrolleristheautomaticmechanismbywhichIheus

8、erinterfaceisdisplayedandbywhicheventsarecommunicatedbetweenthemodelandtheview.(C) Tecontrolleristhelistofabstractclassesinanapplication.(D) ThecontrolleristhewayinwhichtheabstractdomainknowledgeofanapplicationispresentedtotheuserII.Fillinblankandcopletethefollovingprograas.ClassFileSysteaonlyhasone

9、instanceinantplication.(10points*2pointeach)publicclassFiIeSystemprivateHIeSystemSingIeFiIeSystem=null;RleSystem()(IpublicstaticFiIeSystemgetSingleFileSystem()if()(SingIeFiIeSystem=:Ireturn;)III. AccordingtoUMLclassdiagraa,seeFig1.IinplesentstheHunanResourceInformationsystem.Theipleentationvillconsi

10、stofthreeclasses.(20points)Fig1HumanResourceInformationSystemClassDiagramNote:InclassEmployeetoString():overridesthemethodIoStringintheclassObject.ReturnsthestringrepresentationofanEmployeeobject.Thestringreturnedhasthefollowingformat: id,name,WeeklySalary ,hefieldsaresepa,atedbyacomma(,).Youcanassu

11、methatthefieldsthemselvesdonotcontainanycommas.IV. Inthisexaa,youvillcreateanaddressbk)plicationvithaSvingGUI.Partoftheworkhasbeendoneforyou.Youvillimplementthecodethathandlesthebuttonevents.(20points)Fig2AddressBookGUI(1)ImplenennetholactionPerfbmedin(heinnerclassOpenButtonListener:Beginbyremovinga

12、llentriesintheaddressbookifithasanyandclearingthestatusarea.Next,loadthedataintheSPCdfiedfileintothenow-emptyaddressbook.Everylinein(hefileshouldcontainexactlyoneaddressbkentrywiththefollowingformat:name_addressJelephonewhere: *nameisastringthatrepresentsthenameoftheentry.令addressisastringthatrepres

13、entstheaddressoftheenty. telephonei$asiringthatrepresentsIhetelephoneoftheenry.Thefieldsaredelimitedbyanunderscore(_).Tosimplifyyourcode,youcanassumethatthefieldsthemselveswillnotcontainanyunderscores.UsetheclassStdngTCkeniZertoextracttheentryfields.Afterloadingthedataintotheaddressbk.displaythename

14、softhepeopleintheJList.UsethemethodAddressBook.geNamestoobtainanarrayof(henames.Usethemetheandthenoutputastatusmessagein(hes(a(usarea.Thismethodshoulddisplayanerrormessageinthestatusareawhenitdetectsoneof(hefollowingerrors:令Theaddressbookisempty.Theuserha$tselectedaname.班级O*Thisinnerclasshandlescdis

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

当前位置:首页 > 办公文档 > 工作计划

copyright@ 2008-2023 1wenmi网站版权所有

经营许可证编号:宁ICP备2022001189号-1

本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。第壹文秘仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知第壹文秘网,我们立即给予删除!