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 turn(double degrees) public void move(double distance)
Step by Step Solution
3.42 Rating (161 Votes )
There are 3 Steps involved in it
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
Get step-by-step solutions from verified subject matter experts
