面向对象程序设计期末试题A卷.pdf
面向对象程序设计期末试题A卷
青岛大学课程考试试卷2004~2005学年春季学期考试时间:
2005年7月
课程名称面向对象程序设计方法A卷√B卷□
I.True/False(20%)
1.InOOP,asubclassusuallyisis(containingfewer
functionsandlessdata)thanits
superclass.()
2.Ifyoudonotusethereservedwordspublicandprivate,all
membersofaC++classare
privateandallmembersofastructarepublic.()
3.Ifyouhavewrittenyourownheaderfilenamedmytypes.h,
thenthepreprocessor
directive#include
isthecorrectwaytoinsertthecontentsoftheheaderfile
intoaprogram.()
4.Avariableoftypestringcanbeassignedtoavariableof
typechar.()
5.Thegetlinefunctionisamemberfunctionofthestring
class.()
6.Usingareferenceparameter(passingbyreference),the
calledfunctioncanobtainthe
initialvalueofanargumentaswellaschangethevalueof
theargument.()
7.Variablesdeclaredatthebeginningofablockare
accessibletoallremainingstatements
inthatblock,includingthoseinnestedblocks(assumingthe
nestedblocksdon’tdeclare
localvariablewiththesamenames).()
8.InC++,inheritanceallowsaderivedclasstodirectlyaccess
allofthefunctionsanddata
ofitsbaseclass.()
9.Thespecificationofanabstractdatatype(ADT)shouldnot
mentionimplementation
details.()
10.InC++,ifclassXisabaseclassofclassY,thenYcannot
directlyaccessXsprivate
data.()
II.MultipleChoice(20%)
1.1.Whichoneofthefollowingisnotoneofthethreemajor
phasesinthelifecycleofa
2.computerprogram?()
a.theproblem-solvingphase
b.themanagementphase
c.the