I have made a class that gets the starting population, the percent increase daily and the number of days the organisms will be multiplied.public class popul { //Creakte private fields private double pop_organism; private int percentIncrease; private int days_multiply; private double new_population=0; //Make a contructor public popul() { pop_organism=0; percentIncrease=0; days_multiply=1; } //take in a argument public void get_popPercent_daysMult(double population,int percent,int days_mult) { pop_organism=population; percentIncrease=percent; days_multiply=days_mult; } public void calculate_increase() { for(int counter=1;counter<=days_multiply;counter++) { pop_organism=(pop_organism*(percentIncrease/100))+pop_organism; System.out.print("Day"+ " "+counter+ " : "+pop_organism); } } }]
My problem seems to lie in the public void calculate_increase method. For some aparents reason I'm gettingI have been working on this for one hour but just can't seem to figure it out! Thanks guys in advance oh and my sample input I'm using isday 1 : 4.0 day 2: 4.0 day 3: 4.0 day 4: 4.0 day 5: 4.0
pop_organism=4;
percentIncrease=20;
days_multiply=5;