Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ 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

c++

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

Question 2.2. (TCO 4) A Car class, Civic, and Driver class have what type of relationships? (Points : 5)
The Driver has a Civic, and the Civic is a Car. The Driver has a Civic, and the Car is a Civic. The Driver has a Car, and the Civic is a Car. The Driver uses a Car, and the Car is a Civic.

Question 3.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

Question 4.4. (TCO3) What happens right after we gather requirements in the object-oriented design process? (Points : 5)
Developing SOW Identify classes Creating UML diagram Develop prototype

Question 5.5. (TCO 4) In what type(s) of situation(s) would it be best to make a new derived class from a base class? (Points : 5)
When your old class is a general form of what your new class should be When you need to create a specialized class from an existing class A and B None of the above

Question 6.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

Question 7.7. (TCO 2) Given a private attribute called weight, which of the following are proper implementations for a getter and a setter? (Points : 5)
void getWeight(){return weight;}, void setWeight (int weight){this->weight = weight;} int getWeight (){return weight;}, int setWeight (int weight){return weight;} int getWeight (){this->weight = weight;}, void setWeight (int weight){return weight;} int getWeight (){return weight;}, void setWeight (int weight){this->weight = weight;}

Question 8.8. (TCO 4) Consider the following class definitions. class bClass { public: void setX(int a); //Postcondition: x = a; void print() const; private: int x; }; class dClass: public bClass { public: void setXY(int a, int b); //Postcondition: x = a; y = b; void print() const; private: int y; }; Which of the following correctly sets the values of x and y? (Points : 5)
void dClass::setXY(int a, int b) { bClass::setX(a); y = b; } void dClass::setXY(int a, int b) { x = a; y = b; } void dClass::setXY(int a, int b) { x = bClass::setX(a); y = bClass::setY(b); } void dClass::setXY(int a, int b) { x = bClass.setX(a); b = y; }

Question 9.9. (TCO 1) Examine the class definition. How many members does it contain? class Date { public: void setDate(int, int, int); void printDate() const; void setDay(int); void setMonth(int); void setYear(int); int getDay(); int getDay(); int getDay(); private: int day; int month; int year; }; (Points : 5)
6 3 9 11 None of the above

Question 10.10. (TCO 8) Data/information hiding and encapsulation improves construction and maintenance because: (Points : 5)
Program bugs are isolated to a single class Programming to an interface makes the code more logical Both A and B None of the above

Question 11.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

Question 12.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 Both A and B None of the above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions