Question: Instructions: Using Java code please do the following and answer all questions 1-4. Thanks You are give the following interface Movable(): public interface Movable {

Instructions: Using Java code please do the following and answer all questions 1-4. Thanks

You are give the following interface Movable():

public interface Movable {

public void moveForward();

public void moveBackward();

public void stop();

public void moveLeft();

public void moveRight();

}

Base on the Movable interface create three classes: Car(), Plane(), and Ship() that implement it. After that, create a program that will polymorphically process an array of Movable by calling each of the interface methods, after creating an object for each one of the classes. Implement the classes in such a way that the output is:

Plane flying forward

Plane taxiing backward

Plane landed

Plane flying left

Plane flying right

---------------------

Car drives forward

Car drives backward

Car parked

Car turns left

Car turns right

---------------------

Ship navigates forward

Ship navigates backward

Ship docked

Ship navigates left

Ship navigates right

---------------------

Lab Report:

On your OpenLab portfolio create a new page and post the following items:

Description of the lab in your own words.

Source Code.

Screenshots of you program running and results.

Write comments in your source code.

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!