public class Flower { double x, y ; String state = "happy" ; double petalRadius = 0.013 ; public Flower() { x = y = 0.5 ; state = "happy" ; } public Flower(double inx, double iny) { x = inx ; y = iny ; state = "happy" ; } public void setSad() { state = "sad" ; } public void setHappy() { state = "happy" ; } public double getX() { return x ; } public double getY() { return y ; } public void Draw() { if (state.equals("happy") ) { StdDraw.setPenColor(StdDraw.YELLOW) ; } else { StdDraw.setPenColor(StdDraw.GRAY) ; } StdDraw.filledCircle(x + 0.03, y, petalRadius) ; StdDraw.filledCircle(x + 0.02, y+0.02, petalRadius) ; StdDraw.filledCircle(x , y+0.03, petalRadius) ; StdDraw.filledCircle(x - 0.02, y+0.02, petalRadius) ; StdDraw.filledCircle(x - 0.03, y, petalRadius) ; StdDraw.filledCircle(x - 0.02, y-0.02, petalRadius) ; StdDraw.filledCircle(x , y-0.03, petalRadius) ; StdDraw.filledCircle(x + 0.02, y-0.02, petalRadius) ; StdDraw.setPenColor(StdDraw.BLACK) ; StdDraw.filledCircle(x , y, petalRadius) ; } }