Question: Question 2 [15 marks]: Given the following classes: class Transportation { protected: int capacity; public: Transportation() { capacity=0; } Transportation(int cap) { capacity=cap; } /

 Question 2 [15 marks]: Given the following classes: class Transportation {protected: int capacity; public: Transportation() { capacity=0; } Transportation(int cap) { capacity=cap;} / "getters and setter/ virtual void move() = ; void print(){ coutprint(); O Compiler error Explain OOK Possible output? Explain 2-b) Sports

Question 2 [15 marks]: Given the following classes: class Transportation { protected: int capacity; public: Transportation() { capacity=0; } Transportation(int cap) { capacity=cap; } / "getters and setter/ virtual void move() = ; void print() { coutprint(); O Compiler error Explain OOK Possible output? Explain 2-b) Sports Car's; s=new SportsCar(2, "porche"); S->move; O Compiler error Explain OOK Possible output? Explain 2-c) Car *c=new Car(4. "Tesla"); SportsCares; s=c; C->move(): O Compiler error Explain O Ok Possible output? Explain 2-d) Car "c; SportCar 's=new SportCar(4, "chevrolet"); CES; s->move(); O Compiler error Explain ook Possible output? Explain 2-e) Car *c; SportsCar 's=new Sports Car(4, "chevrolet"); C=S; c->displayMake(); O Compiler error Explain OOK Possible output? Explain

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!