What mistake prevents the following class declaration from functioning properly as an abstract class? class Shape
{
Public:
Virtual double print() const;
Double area() const {return base * height;}
Private:
Double base;
Double height;
};
A) There are no pure virtual functions.
B) There is a non-virtual function.
C) private variables are being accessed by a public function.
D) Nothing, it functions fine as an abstract class.
Correct Answer:
Verified
Q7: Virtual destructors must be used when:
A) The
Q8: The main difference between a pure virtual
Q9: Downcasting enables:
A) A derived-class object to be
Q10: Which of the following statements about virtual
Q11: Employee is a base class and HourlyWorker
Q13: To help prevent errors, apply C++11's _
Q14: An abstract class will:
A) Have all zero
Q15: Problems using switch logic to deal with
Q16: Which of the following statements about polymorphism
Q17: Which of the following is not allowed?
A)
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents