public class Growth { public static double getNewPop(double birth, double death, double pop, int years) { for (int i = 0; i < years; i++) { pop = pop + (birth/100*pop - death/100*pop); } return pop; } public static void main(String args[]) { // setup variables double birth = 2.036; double death = 0.476; double oldPop = 108; int years = 100; // compute new population double newPop = getNewPop(birth, death, oldPop, years); // produce output System.out.println("Old population: " + oldPop); System.out.println("New population: " + newPop); } }