Write the class definition for the vehicle class


Problem

The Person class has two instance variables, name and age. It has a third instance variable, vehicle, which is an object of the Vehicle class. Write a class definition for a class called Person. You only need to write the__init_() method which should initialize all instance variables of the class. Use composition to connect the vehicle instance variable to the Person class.

The Vehicle class has two instance variables, make and model. You do not need to write the class definition for the Vehicle class. Assume that the Vehicle class is correctly defined and has a __init__( method which initializes the instance variables make and model.

Then create an object of the Person class with the following values for the instance variables: 'Jane, 54, 'Lexus', 'UX'.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write the class definition for the vehicle class
Reference No:- TGS03277098

Expected delivery within 24 Hours