欢迎来到天天文库
浏览记录
ID:36411564
大小:178.00 KB
页数:9页
时间:2019-05-10
《中山大学信息科学及技术学院计算机科学系C程序设计A2014.06试卷》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、警示《中山大学授予学士学位工作细则》第六条考试作弊不授予学士学位计算机科学系2014学年度第二学期《程序设计II》期末考试试题(A)任课教师:吴维刚刘聪考试形式:闭卷考试时间:2小时年级:班别:专业:姓名:_____学号:_成绩1.SingleChoice(20points)Pleasechoosethechoicethatbestcompletesthestatementinthequestion1)Whichofthefollowingstatementsaboutobject-orientedprogramming(OOP)isNOTcorrect?A)ThekeyideaofOOPis
2、tobuildprogramsusingsoftwareobject.B)OOPoffersmanyadvantages:simplicity,modularity,modifiability,andsoon.C)OOPismoreefficientthanPOPintermsofprogrammingproductivity.D)Anobject-orientedprogramcanrunfasterthanaprocedure-orientedprogramwiththesamefunctionality.2)Whichofthefollowingstatementsaboutstatic
3、datamembersisNOTcorrect?A)Astaticdatamembercaninitializedatdeclaration.B)Astaticdatamemberreferstoamemberwhosevaluecannotbechangedafterinitialized.C)Wemayaccessstaticdatamemberswithoutbeforeanyobjectcreated.D)Astaticdatamemberissharedbyobjectsofthesameclass.3)Whichofthefollowingvariablescannotbeamem
4、berofclassA?A)A*pB)AaC)A&rD)strings4)Whichofthefollowingstatementsisnotacharacteristicofaconstructor?A)Thenameofaconstructormustbethesameastheclass.B)Aconstructorcanbeoverloaded.C)Theparametersofconstructormayhavedefaultvalues.D)Thereturntypeofaconstructormustbe"void".5)IfCisaclassname,howmanytimesi
5、stheconstructorofCcalledin"Ca,b[2],*p[2];"?A)2B)3C)4D)56)Ifpisapointertoanobjectwithamemberfunctionx(),whichofthefollowingaccesstox()iscorrect?A)*p.xB)p->x()C)*p->x()D)*p.x()91)WhichofthefollowingisNOTamemberfunctionofaclass?A)constructorB)destructorC)friendfunctionD)copyconstructor2)IfclassXisdecla
6、redtobethefriendofaclassY,thenwhichofthefollowingstatementsiscorrect?A)YcanaccesstheprotectedmembersofX.B)XcanaccesstheprivatemembersofY.C)IfclassZisdeclaredtobefriendofX,ZbecomesY'sfriend.D)YbecomesX’sfriendautomatically3)Whichofthefollowingdeclarationsofconstantfunctionmemberiscorrect?A)voidprint(
7、)const;B)constvoidprint();C)voidconstprint();D)voidprint(const);4)Torealizepolymorphism,thefollowingtwoelementsarenecessary:A)Multiple-inheritanceandvirtualfunctionB)Virtualinheritanceandfunctionoverl
此文档下载收益归作者所有