Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ Given the declaration statements below in a driver, for each set of instructions indicate by circling the appropriate choice whether - there will be
c++
Given the declaration statements below in a driver, for each set of instructions indicate by
circling the appropriate choice whether
- there will be a compilation error (C), and the reason for it OR
- there will be no error at all (OK) in which case specify the resulting output and explain your answer.
Declaration Statements:
2-a) Transportation *t=new Transportation();
coutprint();
O Compiler error Explain
O Ok Possible output? Explain
2-b) SportsCar *s;
s=new SportsCar(2, "porche");
s->move;
O Compiler error Explain
O Ok Possible output? Explain
2-c) Car *c=new Car(4,"Tesla");
SportsCar *s;
s=c;
c->move();
O Compiler error Explain
O Ok Possible output? Explain
2-d) Car *c;
SportCar *s=new SportCar(4, "chevrolet");
c=s;
s->move();
O Compiler error Explain
O Ok Possible output? Explain
2-e) Car *c;
SportsCar *s=new SportsCar(4,"chevrolet");
c=s;
c->displayMake();
O Compiler error Explain
O Ok Possible output? Explain
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started