1. (TCO 2) Which of the following is not part of a UML diagram? (Points : 2) Object Name Attribute Method All of the above

2. (TCO 2) Java, C# and C++ all allow for the use of comments. Which of the following statements is/are true regarding comments? (Points : 2) Comments may span only one line. Comments may span one or more lines. Comments must span more than one line. None of the above

3. (TCO 2) Attributes of a class can be declared as which of the following? (Points : 2) protected public private All of the above

4. (TCO 2) If a programmer does not explicitly define a _____, a default version will be provided by the compiler. (Points : 2) destructor method constructor attribute All of the above

5. (TCO 2) Encapsulation _____ and provides _____ for program components. (Points : 2) protects an object%u2019s data from unwanted modifications; independence protects an object%u2019s methods from unwanted modifications; independence provides universal access to an object%u2019s attributes; a stable implementation provides universal access to an object%u2019s methods; a stable implementation None of the above

6. (TCO 2) Attributes that are assigned a private accessor can _____. (Points : 2) never be modified be modified directly by an external object change the value of other related attributes be modified by setters defined in the same class None of the above

7. (TCO 2) Object-oriented classes should be designed with the concept of a black box in mind. This means that users of the class should only need to know what _____ and _____ are associated with the class. The actual implementation details need not be known. (Points : 2) interface; implementation inputs; outputs objects; accessors relationships; interfaces

8. (TCO 2) One of the benefits of _____ is that it allows the implementation of a class to change without affecting external entities using that class. (Points : 2) abstraction encapsulation instantiation construction

9. (TCO 2) Given a private attribute called name, which of the following are proper implementations for a getter and a setter? (Points : 2) public: int getName(){return name;}, public: int setName(int newName){return newName;} public: void getName(){return name;}, public: void setName(int newName){name = newName;} public: string getName(){return name;}, public: void setName(string newName){name = newName;} public: string getName(){name = newName;}, public: void setName(string newName){return name;}

10. (TCO 2) Identify the attribute declaration(s) below that most likely adhere(s) to the concept of information/data hiding. (Points : 2) private: string name; private: name; string private name; string name; None of the above



Source link

Leave a Reply

Your email address will not be published.