Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

Question 2 [15 marks]: Given the following classes: class Transportation { protected: int capacity: public: Transportation() { capacity=; 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"); SportsCar *s; S=c; C->move(); O Compiler error Explain OOK Possible output? Explain 2-d) Car *c; SportCar *s=new SportCar(4, "chevrolet"); C=S; S->move(); O Compiler error Explain OOK Possible output? Explain 2-e) Car *c; Sports Car *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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

What is the balanced scorecard? How does it relate to operations?

Answered: 1 week ago

Question

8. Managers are not trained to be innovation leaders.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago