1. (TCO 2) Which statement correctly describes the default access attributes of
ID: 440454 • Letter: 1
Question
1. (TCO 2) Which statement correctly describes the default access attributes of both classes and structures? (Points : 4) Structures are private by default and classes are private by default. Structures are public by default and classes are public by default. Structures are public by default and classes are private by default. Structures have no default access attribute and classes are private by default. 2. (TCO 3) Aggregation is also sometimes called _____. (Points : 4) inheritance instantiation composition encapsulation 3. (TCO 4) A derived class (Points : 4) can never access public members of a base class. can directly access public members of a base class. cannot change the value of public members of a base class. can only directly access private members of the base class. 4. (TCO 4) The new classes that we create from the existing classes are called the _____ classes. (Points : 4) sibling base derived parent 5. (TCO 4) Which of the following class definitions makes the public members of the class aClass become the public members of the class bClass? (Points : 4) class aClass: public bClass{ //...}; class bClass: public aClass{ //...}; class bClass: aClass{ //...}; class aClass: bClass{ //...}; 6. (TCO 4) OOP implements _____. (Points : 4) UML IPE EIP OOD 7. (TCO 4) Consider the following class definitions: class bClass { public: void setX(int); void print() const; private: int x; }; class dClass: public bClass { public: void setXY(int, int); void print() const; private: int y; }; Which of the following statements correctly redefines the member function print of bClass? (Points : 4) void dClass::print() const {dClass:print(); } void dClass::print() const { cout << endl; } void bClass::print() const { cout endl; } void dClass::print() const { bClass::print(); cout } 8. (TCO 4) Which of the following base class members is never inherited by a derived class, regardless of access attributes? (Points : 4) Mutator Accessor Constructor Data 9. (TCO 4) Which of the following statements correctly describes an example of multiple inheritance? (Points : 4) Mother and Father to Children Animal to Reptile to Snake Parent to Child Animal to Mammal and Bird 10. (TCO 8) In a multifile, object-oriented C++ project, which file contains the class definition? (Points : 4) classname.cpp classname.h classname.def classname.hdrExplanation / Answer
1. Structures are public by default and classes are private by default. 2. Aggregation is also sometimes called composition 4. The new classes that we create from the existing classes are called the derived classes. 9. mother and Father to Children 10. classname.h
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.