Question 8. 8. (TCO 2) A class is designed with three public attributes: attribu
ID: 3851422 • Letter: Q
Question
Question 8.8. (TCO 2) A class is designed with three public attributes: attributeOne, attributeTwo and attributeThree. attributeOne is an integer data type, attributeTwo is a double data type and attributeThree is a string data type. Which pseudocode representation(s) of getters would be appropriate for this class? (Points : 5) int getAttributeOne(){
return attributeOne
}
string getAttributeTwo()
{
return attributeTwo
}
int getAttributeThree(int newAttributeThree)
{
attributeThree = newAttributeThree
}
void getAttributeTwo()
{
return attributeOne
}
Both A and D
None of the above Question 9.9. (TCO 2) You are tasked to create an EntertainmentSystem class and you want to minimize data dependencies. You also need to protect specific attributes from outside entities. What object-oriented concept(s) would you use to accomplish these goals? (Points : 5) Composition of classes
Universal access to methods
Inheritance
Encapsulation
All of the above Question 10.10. (TCO 7) Which of the following statements is true? (Points : 5) A pure virtual function is a function without function implementation and is ended with =0;
An actual object can be created from an abstract class.
A pure virtual function is a function that cannot be inherited and therefore must be overloaded.
A pure virtual function cannot be overridden. Question 11.11. (TCO 7) A(n) _____ cannot be instantiated and therefore is used only to form related derived classes. (Points : 5) method
abstract method
class
abstract class Question 12.12. (TCO 7) _____ enforce a(n) _____ which is a methodology used in object-oriented programming to forces programmers to adhere to certain "rules."(Points : 5) Abstract classes; contract
Static variables; hierarchy
Classes; transitive communication
Method signatures; encapsulation
None of the above Question 8.8. (TCO 2) A class is designed with three public attributes: attributeOne, attributeTwo and attributeThree. attributeOne is an integer data type, attributeTwo is a double data type and attributeThree is a string data type. Which pseudocode representation(s) of getters would be appropriate for this class? (Points : 5) int getAttributeOne()
{
return attributeOne
}
string getAttributeTwo()
{
return attributeTwo
}
int getAttributeThree(int newAttributeThree)
{
attributeThree = newAttributeThree
}
void getAttributeTwo()
{
return attributeOne
}
Both A and D
None of the above
Explanation / Answer
8.attributeThree is a string data type. must be used because for you need to encapsulate some fields
9 Encapsulation because encapsulation used for binding of data and for data protections
10 A pure virtual function is a function without function implementation and is ended with =0; //it starts with virtual
11 abstract class it can not be instantiated
12 Method signatures; encapsulation . encapsulation always has accessors and mutators which are returned to the object state .
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.