Lab 10 Prelab Questions 1. Define Polymorphism. 2. Give a real world example of the concept of Polymorphism. 3. Explain the difference between virtual and pure virtual. Provide an example in which you use each. 4. Describe the benefits of using polymorphism. 5. Write 3 to 5 class definitions (header files) that demonstrate the benefits of polymorphism. 6. Consider the following code fragment: class DriverHandle { int handle; public: virtual void sync() = 0; }; Is the above class an abstract class? Why or why not? 7. If we try to define an object of the above DriverHandle class, what will happen? What is the use of this class, if we cannot define an object for it? 8. Consider the following classes: class NoVirtual { int a,b; public: void func(); }; class WithVirtual { int a,b; public: virtual void func(); }; Suppose you create an object of each in main. What are the sizes of these objects? Are they the same? If not, why? 9. Consider the following code: class Vehicle { // ... public: virtual void start() { cout << "Start vehicle...."; } void stop { cout << "Stop the vehicle ...."; } }; class Car { // ... public: void start() { cout << "Hit the road!"; } void stop() { cout << "No more gas!"; } }; int main() { Car merc; Vehicle *v = &merc; v->start(); v->stop(); } What is the expected output for the above piece of code? Why?