Question: A boat floats in a two-dimensional ocean. It has a position and a direction. It can move by a given distance in its current direction,

A boat floats in a two-dimensional ocean. It has a position and a direction. It can move by a given distance in its current direction, and it can turn by a given angle.

Provide methods:

public double getX() public double getY() public double getDirection () public void

public double getX() public double getY() public double getDirection () public void turn(double degrees) public void move(double distance)

Step by Step Solution

3.42 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The given methods seem to belong to a class that would represent a boat in a twodimensional environment like an ocean To provide these methods as part ... View full answer

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 Java Programming Questions!