Question: I need help with this Java project Create a base class called Vehicle that has the manufacturer's name (String), number of cylinders in the engine

I need help with this Java project

Create a base class called Vehicle that has the manufacturer's name (String), number of cylinders in the engine (int), horsepower (int) and owner (type Person from previous assignment).

The Vehicle class should have 2 constructors:

Parameterized constructor (manufacturerName, numberCylinder, horsepower, owner)

Copy constructor

Now, create a class Truck that is derived from Vehicle and has additional instance variables: load capacity in tons (double) and towing capacity in tons (also type double).

The Truck class should have 2 constructors:

Parameterized constructor (manufacturerName, numberCylinder, horsepower, owner, loadCapacity, towingCapacity)

Copy constructor

Give your classes a reasonable complement of accessor and mutator methods, an equals( ) method and a toString( ) method. Write a driver (no pun intended) program to test both classes.

Below is an inheritance diagram in UML (Unified Modeling Language) of the three classes:

I need help with this Java project Create a base class called

Vehicle Class E Fields horsepower manufacturerName number Cylinders owner E Methods equals getHorsepower getManufacturerName get owner set Horsepower set ManufacturerName set owner toString ehicle 1 overload) Truck Class vehicle E Fields oad Capacity towing capacity E Methods equals getLoadCapadty getTo ng Capacity set LoadCapadty set Towing Capacity toString Truck 1 overload)

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!