Suppose that we have a function that registers a Vehicle object. We also have a Car object that is a specialized Vehicle (defined by inheritance). The substitution principle states The Car object can be used in the Vehicle registration function because it is a kind of Vehicle. The Car object can never be used in any function that is written to use a Vehicle object. The Vehicle object can always be used wherever a Car object is expected. A new registration function that is written to use a Car object can be used in place of the Vehicle registration function.
Suppose that we have a function that registers a Vehicle object. We also have a Car object that is a specialized Vehicle (defined by inheritance). The substitution principle states The Car object can be used in the Vehicle registration function because it is a kind of Vehicle. The Car object can never be used in any function that is written to use a Vehicle object. The Vehicle object can always be used wherever a Car object is expected. A new registration function that is written to use a Car object can be used in place of the Vehicle registration function.
Related questions
Question
C++
![Suppose that we have a function that registers a Vehicle object. We also have a
Car object that is a specialized Vehicle (defined by inheritance). The substitution
principle states
The Car object can be used in the Vehicle registration function because
it is a kind of Vehicle.
The Car object can never be used in any function that is written to use a
Vehicle object.
The Vehicle object can always be used wherever a Car object is expected.
A new registration function that is written to use a Car object can be used in
place of the Vehicle registration function.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fd8badeeb-990f-4af1-8fd1-eb21fafff42d%2F193e93d9-a2e1-4daa-a49e-92eed23d811f%2Ft1qfvye_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Suppose that we have a function that registers a Vehicle object. We also have a
Car object that is a specialized Vehicle (defined by inheritance). The substitution
principle states
The Car object can be used in the Vehicle registration function because
it is a kind of Vehicle.
The Car object can never be used in any function that is written to use a
Vehicle object.
The Vehicle object can always be used wherever a Car object is expected.
A new registration function that is written to use a Car object can be used in
place of the Vehicle registration function.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)