CIS247C Quiz Week 6
$5.00
CIS247C Quiz Week 6
(TCO 7) Which is the prototype for a pure virtual function in class Person…
Description
CIS247C Quiz Week 6
CIS247C Quiz Week 6
(TCO 7) An abstract class can contain _____.
Pure virtual functions
Ordinary functions
Both A and B
None of the above
(TCO 7) What is an abstract class?
Any class which can be instantiated
A class without any subclasses
A class without any subclasses
Any superclass with more than one subclass
(TCO 7) Which of the following statements is false?
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.
If a derived class extends an abstract base class, the derived class must implement the pure virtual functions declared in the abstract base class.
Pure virtual functions are inherited.
(TCO 7) Which of the following classes is most likely an abstract class?
EvoCellPhone
EvoCellPhone
Building
Rose
(TCO 7) In terms of object-oriented programming, a contract is a mechanism that forces a programmer to adhere to a predefined application programming interface or _____.
Method signature
Class declaration
Framework
Object instantiation method
None of the above
(TCO 7) Which is the prototype for a pure virtual function in class Person called DisplayDescription which has no inputs and no returned value?
Void virtual DisplayDescription ()
Virtual void DisplayDescription () = 0;
Virtual void TVGame:: DisplayDescription() {}
Virtual void TVGame:: DisplayDescription() {}
(TCO 7) Some object-oriented languages such as C++ allow for _____, while other object-oriented languages such as Java and .NET do not.
Abstract classes
Multiple inheritance
Class overloading
Method instantiation
(TCO 7) Which of the following classes represent an abstract class?
Class Plant {
virtual void grow()=0;
}
Class Plant {
virtual void grow ();
}
Class Plant {
virtual void grow (){}
}
Class Plant {
virtual void grow (){}
}
(TCO 7) Which of the following declares a pure virtual function in an abstract C++ class?
Public: virtual void method()=0;
Public: void method() {}
Public: void Method();
Public: void method()=0
(TCO 7) What is the coding requirement(s) that a programmer must follow when writing virtual functions?
The programmer must use a “virtual” keyword in the parent class.
The parent class must have specific implementation coded in the .cpp file.
The base class must use a different name for the function than the parent class.
There are no specific coding requirements for using the “virtual” keyword.