In java define a class called vehicle that defines the


In Java Define a class called Vehicle that defines the following attributesmake - a string representing the company that made the vehicle (e.g., "Pontiac", "Honda", etc..) model - a string representing the model of the vehicle (e.g., "Grand Prix", "Civic", etc..) year - an int representing the year of the vehicle (e.g., 2004 etc..) color - a string representing the color of the vehicle (e.g., "red", "blue" etc..) plate - a string representing the license plate of the vehicle (e.g., "X5T6Y8", "2FAST", etc..) owner - a Driver object representing the owner of the vehicle (e.g., John Doe from part 1) reportedStolen - a boolean indicating whether or not the vehicle has been reported as stolen

Write the following in the Vehicle class: 1 a proper constructor that takes 5 parameters for the first 5 attributes in the order shown above (assume new vehicles are not stolen and there is no owner yet). a proper zero-parameter constructor that calls the first constructor with appropriate values a toString() method that returns a string in the following format: "A blue 1998 Honda Civic with plate X5T6Y8"

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: In java define a class called vehicle that defines the
Reference No:- TGS02644068

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)