Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (TCO 7) An abstract class can contain _____. (Points : 2) pure virtual functi

ID: 3638051 • Letter: 1

Question

1. (TCO 7) An abstract class can contain _____. (Points : 2)
pure virtual functions
ordinary functions
Both A and B
None of the above


2. (TCO 7) An abstract _____ is used only to form related derived classes using inheritance since it cannot be instantiated. (Points : 2)
method
class
object
attribute


3. (TCO 7) Which of the following statements is false? (Points : 2)
A pure virtual function is a function without function implementation and can be found in an abstract class.
If a derived class extends an abstract base class, the derived class must implement the pure virtual functions declared in the abstract base class.
Any method in an abstract class is considered a pure virtual function.
Pure virtual functions are inherited.


4. (TCO 7) Which of the following classes is most likely an abstract class? (Points : 2)
EvoCellPhone
FijiApple
Building
Rose


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


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;


7. (TCO 7) C++ allows for the implementation of multiple inheritance, whereas .Net and Java do not. However, in languages such as .Net and Java, _____ can be used to simulate multiple inheritance. (Points : 2)
abstract methods
base classes
interfaces
implementations


8. (TCO 7) Which of the following classes represent an abstract class? (Points : 2)
class Dog {
void eat()=0;
}
class Dog {
virtual void eat ()=0;
}
class Dog {
void eat ();
}
class Dog {
void eat (){}
}


9. (TCO 7) Which of the following declares an abstract method in an abstract C++ class? (Points : 2)
public: void print();
public: void print() {}
public: virtual void print() {}
public: virtual void print()=0;


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

Please Rate: Thanks 1. Both A and B (An abstract class contains many ordinary functions and atleast one virtual function. you can declare the pure virtual function by using the pure specifier(=0)) 2.class 3.Any method in an abstract class is considered a pure virtual function. 4.EvoCellPhone and FijiApple 5.abstract class;method 6.virtual void DisplayDescription () = 0; 7.interfaces 8.the following class needed to represent an abstract class class Dog { virtual void eat ()=0; } 9.public: virtual void print()=0; 10.void Media::AdvertisingRatio() = 0;