Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (TCO 2) Which of the following statements is/are true? (Points : 2) Object na

ID: 3633294 • Letter: 1

Question

1. (TCO 2) Which of the following statements is/are true? (Points : 2)
Object names are listed in the middle section of a UML diagram.
Attribute names are listed in the middle section of a UML diagram.
Method names are listed in the middle section of a UML diagram.
Class names are listed in the middle section of a UML diagram.
None 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) A(n) _____ has the same name as the class it is declared in, it is used to initialize attributes, and accepts zero arguments. (Points : 2)
default destructor
default constructor
initializing method
instantiation
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) Accessors such as “+” and "-" can be used to dictate how external programs, objects, and entities interact with _____. (Points : 2)
an entire class only
all attributes and methods in a class
attributes of a class only
methods of a class only
None 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) 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) Which of the following is a proper implementation for a setter? (Points : 2)
int setAge() { return age;}
void setAge(int age) {this.age = age;}
void setAge(int newAge) {return age;}
void setAge() {return age;}

10. (TCO 2) Identify the setter declaration(s) below that most likely contribute to the concept of information/data hiding. (Points : 2)
private string setName(){this.name = name;}
public string setName(){this.name = name;}
public void setName(string name){this.name = name;}
private void setName(string name){this.name = name;}
None of the above

Explanation / Answer

Hi, Here are the answers to Your 10 Questions. plz check and let me know if need any clarification. Ans 1: Attribute names are listed in the middle section of a UML diagram. Ans 2: All of the above Ans 3: behaviors Ans 4: default constructor Ans 5: protects an object’s data from unwanted modifications; independence Ans 6: attributes of a class only Ans 7: a basic understanding of its implementation Ans 8: encapsulation Ans 9: void setAge(int age) {this.age = age;} Ans 10: private void setName(string name){this.name = name;} Thanks & Regards, Sachin