import java.util.Arrays; public class Cloud { /* * Version 1.0 */ /* insert your name here */ private Point[] points; // Array of Points contained in this Cloud private int maxSize; // The maximum number of points allowed in this Cloud private int size; // The current number of points in this Cloud /** * * pre: None * post: returns true if the Cloud is full * * A Cloud is defined as full when the current number of points * in the Cloud is equal to the maximum number of points in the * Cloud. */ public boolean isFull(){ System.out.println("isFull not implemented yet"); return false; } /** * * pre: None * post: returns true when the Cloud is empty * * A Cloud is defined as empty when there are no Points in the * Cloud. */ public boolean isEmpty(){ System.out.println("isEmpty not implemented yet"); return false; } /** * * pre: p is a Valid point * post: returns true if the Point p is contained in the Cloud * *The intuition here is to look through the points array and *discover if a point that is equal to the argument p is in that array. */ public boolean hasPoint(Point p){ System.out.println("hasPoint not implemented yet"); return false; } /** * pre: maxSize > 0 * post: a Cloud has been constructed, and a points * array has been created of size maxSize. */ public Cloud(int maxSize){ System.out.println("Cloud constructor not implemented yet"); } /** * * pre: p is a valid Point * post: * if (size < maxSize) add p to points, increment size * return true if p added to points, * return false if not added because size == maxSize */ public boolean addPoint(Point p){ System.out.println("addPoint not implemented yet"); return false; } /* * * pre: None * post: A string is returned that represents the Cloud * This string should take the form of {a,b,c} where * a, b, and c are valid representations of the points * in the Cloud * * The result of an empty Cloud would be {}. */ public String toString(){ System.out.println("toString not implemented yet"); return ""; } /** * * pre: None * post: return null if Cloud is empty * else return an array of Points: leftmost, rightmost, top, bottom */ public Point[] extremes(){ System.out.println("extremes not implemented yet"); return null; } /** * * pre: None * post: return null if the Cloud is empty * otherwise, create and return the center point * * The center point is defined as the average x and the average y for all * the points in the Cloud. */ public Point centerP(){ System.out.println("centerP not implemented yet"); return null; } /** * pre: None * post: returns null if the Cloud is empty, * returns an array of the two Points in the Cloud that are closest together otherwise. * If the Cloud has only one Point, return a size 1 array with that one Point in it. */ public Point[] minDist(){ return null; } /** * @param args:no args */ public static void main(String[] args) { // TODO test all cloud methods /* * Place your test cases here */ } }