Challenge 1: Cars and Engines!
In this exercise, you have to perform a composition between a sedan car class and its engine.
We'll cover the following...
Problem statement
You have to implement a Sedan
class, which inherits from the Car
class and contains a SedanEngine
object.
Note: In such a composition relation, the
Sedan
class will be responsible forSedanEngine
lifetime.
Consider this diagram for reference:
Task 1
-
The
Car
initializer should take arguments in ...