Challenge 1: Implement the Derived Class

Can you Implement the Derived Class function by using the Base Class functions? A solution is placed in the "solution" section to help you, but we would suggest you try to solve it on your own first.

Problem Statement

Implement a function getDetails(String carName) of the Derived Class Car which takes a string carName and appends it with model, name, and speed. We have already implemented the Base Class Vehicle with the member functions getModel() and getSpeed() which return the model and speed of the car respectively.

Input

Car Name

Output

Car Name, Model, Speed

Sample Input

                  "Roadster";

Sample Output

                  "Roadster, Tesla, 100"; 

Get hands-on with 1200+ tech skills courses.