/* * Shapes.java * CS 2510, Lab 2 */ // Examples of our data, and later... tests class Examples{ Examples(){} IShape circ = new Circle(100, 100, 80); IShape rect = new Rect(100, 100, 200, 200); IShape cmbo = new Combo(this.rect, this.circ); } // Represents a geometric shape interface IShape{} // Represents an Oval class Circle implements IShape{ int cx; int cy; int rad; Circle(int cx, int cy, int rad){ this.cx = cx; this.cy = cy; this.rad = rad; } } // Represents a square class Rect implements IShape{ int cx; int cy; int w; int h; Rect(int cx, int cy, int w, int h){ this.cx = cx; this.cy = cy; this.w = w; this.h = h; } } // Represents the combination of two Shapes class Combo implements IShape{ IShape top; IShape bot; Combo(IShape top, IShape bot){ this.top = top; this.bot = bot; } }