/** * Write a description of class Vector here. * * @author (your name) * @version (a version number or a date) */ public class Vector { // instance variables - replace the example below with your own private int x; private int y; public Vector(int xValue, int yValue) { x = xValue; y = yValue; } public int getX () { return x; } public void setX(int xValue) { x = xValue; } public int getY () { return y; } public void setY(int yValue) { y = yValue; } public double length() { return (Math.sqrt(x*x+y*y)); } public void add(Vector vectorToAdd) { x = x+vectorToAdd.getX(); y = y+vectorToAdd.getY(); } }