Create an enumerated data type Color for the possible flower colors for a plant (red, purple, white, none) Create an abstract class Plant with the following features: • class variable ENERGY_SOURCE whose value is “carbon dioxide” • instance variables for color and watering • no-argument constructor that sets flower color to white • constructor that takes user-specified color (both constructors should set watering by calling getRandomWatering()) • getter • setter • toString() • abstract method getRandomWatering() that returns int for days between watering Create a Fern class that extends Plant and contains the following: • no-argument constructor that assigns color value of none (ferns don’t have flowers) • method getRandomWatering() that returns 7 three out of five times, 10 the rest • toString() Create a Succulent class that extends Plant and implements Comparable and contains the following: • class variable called numberOfSucculents to count succulent objects • class method numberOfSucculents() that returns number of succulents • instance variable hasSpines that is set to true if plant is a cactus, false otherwise • no-argument constructor that assigns default value of false for hasSpines and white for color • constructor that assigns user-specified values for hasSpines and color • copy constructor • getter (call it hasSpines rather than getSpines since it returns a boolean) • setter • toString() • method getType() that returns “cactus” if hasSpines is true, “succulent” otherwise • method isSameType() that returns true if both plants are the same subtype • method getRandomWatering() that returns a random value between 14 and 28 • method compareTo() that returns 1 if first plant can go more days between waterings, 0 if both same, -1 if first can go fewer days Solution package org.learning.chegg; public enum Color { RED, PURPLE, WHITE, NONE; } package org.learning.chegg; public abstract class Plant { public static String ENERGY_SOURCE = \"carbon dioxide\"; /* * Color of the plant */ private Color color; /* * days between watering */ private int watering; public Plant() { this.color = Color.WHITE; this.watering = getRandomWatering(); } public Plant(Color color){ this.color = color; this.watering = getRandomWatering(); } public Color getColor() { return color; } public void setColor(Color color) { this.color = color; } public int getWatering() { return watering; } public void setWatering(int watering) { this.watering = watering; } @Override public String toString() { return \"Plant[Color: \"+this.color+\", Watering: \"+this.watering+\"]\"; } public abstract int getRandomWatering(); } package org.learning.chegg; public class Fern extends Plant { public Fern() { setColor(Color.NONE); } private static int chance = 1; @Override public int getRandomWatering() { if(chance < 4){ chance++; return 7; }else{ chance++; if(chance == 7){ chance = 1; } return 10; } } } package org.learning.chegg; public class Succulent extends Plant implements Comparable{ pr.