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 represent(s) valid comments in these three languages? (Points : 2)
*/ Comment */
/ Comment /
-- Comment --
<! Comment !>
All of the above
None of the above
3. (TCO 2) Attributes represent the _____ of an object because they store information about that object. (Points : 2)
state
behaviors
size
accessibility
4. (TCO 2) If a programmer explicitly defines a constructor that accepts parameters, he or she should also define a _____ version, as a best practice. (Points : 2)
private
public
static
default
None of the above
5. (TCO 2) Encapsulation _____ and provides _____ for program components. (Points : 2)
protects an object’s data from unwanted modifications; independence
protects an object’s methods from unwanted modifications; independence
provides universal access to an object’s attributes; a stable implementation
provides universal access to an object’s methods; a stable implementation
None of the above
6. (TCO 2) Which of the following symbols indicate level of access for both attributes and methods in a class. (Points : 2)
&&
/
-
||
All of the above
7. (TCO 2) A black box is a term used to describe a system that can be understood solely based on its inputs, the resulting outputs and _____. (Points : 2)
its object-specific instantiated behavior
its object-specific state at any given time
a detailed understanding of its implementation
a basic understanding of its implementation
8. (TCO 2) Which of the following statements is true about encapsulation? (Points : 2)
Encapsulation assists in combining more than one class together in a single, cohesive entity.
Encapsulation assists with messaging between objects because it allows full access of all attributes to outside entities.
Encapsulation assists with the creation of code that is reusable.
Encapsulation is another term for object-oriented design.
9. (TCO 2) Given a private attribute called age, which of the following are proper implementations for a getter and a setter? (Points : 2)
void getAge(){return age;}, void setAge(int newAge){age = newAge;}
int getAge(){return age;}, int setAge(int newAge){return newAge;}
int getAge(){age = newAge;}, void setAge(int newAge){return age;}
int getAge(){return age;}, void setAge(int newAge){age = newAge;}
10. (TCO 2) Identify the attribute declaration(s) below that most likely contribute to the concept of information/data hiding. (Points : 2)
private string name;
private name;
string private name;
string name;
None of the above
Which of the following is not part of a UML diagram
- Technology: Multiple-Choice-Questions
- Code: SHC_MCQ_10008
-
$9.99
Tags: UML, Java, C#, C++, Multiple choice question, MCQ, object oriented programming, unwanted modifications, Encapsulation