1. (TCO 7) An instance of an abstract class can be created using _____. (Points
ID: 3558323 • Letter: 1
Question
encapsulation
a public accessor
None of the above Question 2.2. (TCO 7) What is an abstract class? (Points : 2) A generalized class used only to create related derived classes
A class without any superclasses
A class from which we create many instances
Any subclass with more than one superclass Question 3.3. (TCO 7) How is the pure virtual function different from a regular function? (Points : 2) It can only be declared in an abstract class.
It is declared with =0 at the end of the function signature.
It does not contain function implementation.
All of the above Question 4.4. (TCO 7) Which of the following classes is most likely an abstract class? (Points : 2) BlackWidow
Dime
Aspirin
Tree Question 5.5. (TCO 7) _____ and _____ can be used to implement a contract in an object-oriented application. (Points : 2) base class; method
abstract class; interface
abstract method; interface
abstract class; method
None of the above Question 6.6. (TCO 7) Which is the prototype for a pure virtual function in class Person called DisplayDescription which has no inputs and no returned value? (Points : 2) void virtual DisplayDescription ()
virtual void DisplayDescription () = 0;
virtual void TVGame:: DisplayDescription() {}
void virtual TVGame:: DisplayDescription (string) = 0; Question 7.7. (TCO 7) Some object-oriented languages such as C++ allow for _____, while other object-oriented languages such as Java and .NET do not. (Points : 2) abstract classes
multiple inheritance
class overloading
method instantiation Question 8.8. (TCO 7) Which of the following classes represent an abstract class? (Points : 2) class Plant {
virtual void grow()=0;
}
class Plant {
virtual void grow ();
}
class Plant {
virtual void grow (){}
}
class Plant {
virtual void grow (){}
} Question 9.9. (TCO 7) Which of the following declares an abstract method in an abstract C++ class? (Points : 2) public: void pay()=0;
public: void pay() {}
public: virtual void pay()=0;
public: virtual void pay() {} Question 10.10. (TCO 7) Assume the function AdvertisingRatio is a pure virtual function. Which prototype would a programmer use in the class declaration for the class Media? (Points : 2) void virtual AdvertisingRatio() = 0;
virtual void AdvertisingRatio()
virtual void AdvertisingRatio() = 0;
void Media::AdvertisingRatio() = 0;
Explanation / Answer
1) None of the above
2) A generalized class used only to create related derived classes
3) It is declared with =0 at the end of the function signature.
4) Tree
5) abstract class; interface
6) virtual void DisplayDescription () = 0;
7) multiple inheritance
8) class Plant {
virtual void grow()=0;
}
9) public: virtual void pay()=0;
10) virtual void AdvertisingRatio() = 0;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.