Course Hero Logo

Boat.java - package labs.lab2 /* * A boat that floats in a...

This preview shows page 1 - 2 out of 2 pages.

package labs.lab2;/*** A boat that floats in a 2D ocean*/public class Boat {// ADD YOUR INSTANCE VARIABLES HEREprivate double x_coord = 0.0;private double y_coord = 0.0;private double d_angle = 0.0;/*** Creates a boat with an initial position and direction angle.** @param xthe x coordinate of the boat's initial position.* @param ythe y coordinate of the boat's initial position.* @param angle angle of the boat's direction (in degrees from x axis)*/public Boat(double x, double y, double angle) {x_coord = x;y_coord = y;d_angle = angle;// FILL IN}/*** Retrieves the x coordinate of the boat's current position.** @return the x coordinate of the boat's position*/public double getX() {return x_coord; // FIX ME}/*** Retrieves the y coordinate of the boat's current position.** @return the y coordinate of the boat's position*/
End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
N/A
Tags
Cartesian Coordinate System, Exponentiation, Coordinate system, Clockwise, param

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture