/* * Monitors Roach Population */ public class RoachPopulation { private double population; /* * Constructs the Roach Population * @param theInitial The Initial Population */ public RoachPopulation(int theInitial) { this.population = theInitial; } /* * Allows roaches to double in population */ public void waitForDoubling() { this.population = 2 * this.population; } /* * Reduces Roach Population by 10% */ public void spray() { this.population = this.population - (.1 * this.population); } /* * Returns the number of roaches * @return The number of Roaches */ public double getRoaches() { return this.population; } }