Question: In c++ Below is a recipe for constructing a primitive car. All class names start with a capital letter. Compose a Car from some objects,

In c++

Below is a recipe for constructing a primitive car. All class names start with a capital letter. Compose a Car from some objects, you

should use: one Engine, four Wheels, one Chassis, ten Lights, and one Body.

Feel free to define the attributes of these classes. Every

class (including Car) must have a print method.

In the print method of Car, you just need to call the print method from all the objects.

Create one car and call a print method.

Example input

Just print values for one car.

Example output

Engine: 1.0

Wheel: 16inches

Wheel: 16inches

Wheel: 16inches

Wheel: 16inches

Chassis: Normal

Light: Type 1

Light: Type 1

Light: Type 2

Light: Type 2

Light: Type 3

Light: Type 3

Light: Type 4

Light: Type 4

Light: Type 5

Light: Type 5

Body: Black

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!