欢迎来到天天文库
浏览记录
ID:35504670
大小:73.54 KB
页数:8页
时间:2019-03-25
《面向对象程序设计期末试题a卷》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.1.2.青岛大学课程考试试卷2004〜2005学年春季学期考试吋间:2005年7月课程名称面向对象程序设计方法A卷/B卷口题号•・•-三卩L
2、五六成绩复核得分阅卷得分阅卷人I.True/False(20%)1.InOOP,asubclassusuallyis”smaller"(containingfewerfunctionsandlessdata)thanitssuperclass.()2.Ifyoudonotusethereservedwordspublicandprivate,allmembe
3、rsofaC++classareprivateandallmembersofastructarepublic.()3.Ifyouhavewrittenyourownheaderfilenamedmytypes.h,thenthepreprocessordirective#includeisthecorrectwaytoinsertthecontentsoftheheaderfileintoaprogram.()4.Avariableoftypestringcanbeassigne
4、dtoavariableoftypechar.()5.Thegetlinefunctionisamemberfunctionofthestringclass.()6.Usingareferenceparameter(passingbyreference),thecalledfunctioncanobtaintheinitialvalueofanargumentaswellaschangethevalueoftheargument.()7.Variablesdeclaredatthebeginningo
5、fablockareaccessibletoallremainingstatementsinthatblock,includingthoseinnestedblocks(assumingthenestedblocksdon^tdeclarelocalvariablewiththesamenames).()8.InC++,inheritanceallowsaderivedclasstodirectlyaccessallofthefunctionsanddataofitsbaseclass.()9.The
6、specificationofanabstractdatatype(ADT)shouldnotmentionimplementationdetails.()10.InC++,ifclassXisabaseclassofclassY,thenYcannotdirectlyaccessX'sprivatedata.()得分阅卷人ILMultipleChoice(20%)Whichoneofthefollowingisnotoneofthethreemajorphasesinthelifecycleofac
7、omputerprogram?()a.theproblem-solvingphaseb.themanagementphasec.theimplementationphased.themaintenancephase2.Whichofthefollowingtranslatesaprogramwritteninahigh-levellanguageintomachinecode?()a.amouseb.acompilerc.anoperatingsystemd・aneditor3.Giventhetwo
8、linesofinputdataABCDEwhatvalueisreadintoch3bythefollowingcode?(Allvariablesareoftypechar.)cin»ch1»ch2»ch3;()a.Bb.Wc.'Cd・De.noneoftheabove4・Whichtypeofloopwouldbemostappropriateforsolvingtheproblem^Calculatethesumofalltheoddintegersinadatafileofunknownle
9、ngth”?()a.acount-controlledloopb.aflag-controlledloopc.asentinel-controlledloopd.anEOF-controlledloope.eitherborcabove5.Passingbyreferenceisusedifaparameter^dataflowis()a.one-way,intothefunction.b.one-way,outofthefunction.c.two-w
此文档下载收益归作者所有