1. (TCO 4) Which of the following terms can be used to describe inheritance rela
ID: 3645662 • Letter: 1
Question
1. (TCO 4) Which of the following terms can be used to describe inheritance relationships between classes? (Points : 5) parent/child
super/sub
base/derived
All of the above
They have nothing in common and therefore have no relationships.
class Cylinder is the base class.
class Cylinder is derived from GeometricObject.
Explanation / Answer
Solution:
1. (TCO 4) Which of the following terms can be used to describe inheritance relationships between classes? (Points : 5)
parent/child
super/sub
base/derived
All of the above
2. (TCO 4) There are two classes: class GeometricObject and class Cylinder. Which one is the base class and which one is the derived class? (Points : 5)
class GeometricObject is the derived class from Cylinder.
They have nothing in common and therefore have no relationships.
class Cylinder is the base class.
class Cylinder is derived from GeometricObject.
3. (TCO3) Which of the following might be potential class(es) in an application? (Points : 5)
shape
colorShape
drawShape
All of the above
None of the above
4. (TCO3) What does SOW stand for in the object-oriented design process? (Points : 5)
Sequence of work
Structure of work
Statement of work
None of the above
5. (TCO 4) What are the benefits of creating another derived class instead of adding new functionality to the existing class? (Points : 5)
Saves time on debugging the program
Simplifies testing
No need to re-test the previously written class
All of the above
None of the above
6. (TCO 6) _____ is the ability to use the same expression to denote different implementation depending on the type of object calling the expression. (Points : 5)
Inheritance
Encapsulation
Polymorphism
Composition
7. (TCO 2) Given a private attribute called favoriteColor, which of the following are proper implementations for a getter and a setter? (Points : 5)
int getFavoriteColor(){return favoriteColor;}, int setFavoriteColor(int favoriteColor){return favoriteColor;}
void getFavoriteColor (){return favoriteColor;}, void setFavoriteColor (int favoriteColor){this->favoriteColor = favoriteColor;}
String getFavoriteColor (){return favoriteColor;}, void setFavoriteColor (String favoriteColor){this->favoriteColor = favoriteColor;}
String getFavoriteColor (){this->favoriteColor = favoriteColor;}, void setFavoriteColor (String favoriteColor){return favoriteColor;}
8. (TCO 4) To create a class Customer that derives from the class Person, you should use the following syntax:
class Customer ____ public Person
{
// other statements go here
};
(Points : 5)
extends
:
::
None of the above
9. (TCO 1) Examine the class definition. How many members does it contain?
class Date
{
public:
void setDate(int, int, int);
void setDay(int);
void setMonth(int);
void setYear(int);
int getDay(); int getDay(); int getDay();
private:
int day;
int month;
int year;
};
(Points : 5)
5
3
10
None of the above
10. (TCO 8) Data/information hiding and encapsulation improves construction and maintenance because: (Points : 5)
Adding additional details is isolated to a single class
Program bugs are isolated to a single class
Programming to an interface makes the code more logical
All of the above
None of the above
11. (TCO 8) What are some of the characteristics of a "good" comment? (Points : 5)
Detailed comments should address all aspects of the code and structure
Code markers should be used to show what the developer still needs to do.
Comments showing the intent of the code
All of the above
None of the above
12. (TCO 9) Which of the following allow a programmer to reduce the complexity of an object-oriented program? (Points : 5)
Create each class in a separate file
Using namespaces as a container for logically related items
Using namespace to create global types
All of the above
None of the above
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.