Question: Question 1 5 pts (TCO 7) Programmers may be forced to adhere to a contract or a specification defined by a framework due to the
Question 1 5 pts (TCO 7) Programmers may be forced to adhere to a contract or a specification defined by a framework due to the use of _____. abstract classes base classes is-a relationships None of the above
Question 2 5 pts (TCO 4) If you have a complete, working Employee class that has been thoroughly tested, and you wish to add an overloaded getSalary() method that can calculate the salary of a Manager which is the total of salary and bonus, how should this be accomplished? Make a brand new class. Add the method to your existing Employee class. Add the method in the same class as the main. Derive a new Manager class from the first Employee class.
Question 3 5 pts (TCO 4) In what type(s) of situation(s) would it be best to make a new derived class from a base class? When your current 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 4 5 pts (TCO 4) Suppose class Child is derived from class Parent which in turn is derived from class GrandParent. When we destroy an object of class Child, three destructors are called: i) Child, ii) Parent, iii) GrandParent. What is the order? Child, Parent, GrandParent Parent, GrandParent, Child GrandParent, Child, Parent GrandParent, Parent, Child
Question 5 5 pts (TCO 4) Which of the following is not a good example of a hierarchy that could be modeled with inheritance? Order Dog Animals Odd numbers
Question 6 5 pts (TCO 1) Examine the class definition. How many members does it contain? class clockType { public: void setTime(int, int, int); void getTime()const; void printTime() const; void icrementSeconds(); void incrementMinutes(); void incrementHours(); bool equalTime(const clockType&) const; private: int hr; int min; int sec; }; 7 3 An average of 5 because (7 + 3) / 2 = 5 10
Question 7 5 pts (TCO 8) Data/information hiding and encapsulation improves construction and maintenance because: programs become more self-documenting. procedural programming practices are supported. adding additional details is isolated to a single class. All of the above None of the above
Question 8 5 pts (TCO 8) What are some of the characteristics of "self-documenting" code? Detailed comments, addressing all aspects of the code Deep levels of nesting to ensure all situations are addressed Straightforward algorithms All of the above None of the above
Question 9 5 pts (TCO 9) Which of the following allow a programmer to reduce the complexity of an object-oriented program? 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
