Code seems to skip over if or for loop
<ol>
<li><p>When I enter input that satisfies everything and doesn't trigger any of my errors, the program just exits after last input like it is skipping over the <code>for</code> or <code>if</code> loop.</p></li>
<li><p>Also after <code>System.out.printf("Enter the name of your second species: ");</code> it won't allow for any input, it just skips to the next prompt. I'm not sure why that is. The section above it asking for the first species' info works fine.</p></li>
</ol>

<p></p>

<pre><code>import java.util.Scanner;

public class HW2johnson_pp1 {

    public static void main(String args[]) {

        Scanner keyboard = new Scanner(System.in);

        System.out.printf("Please enter the species with the higher" + 
                          " population first\n");
        System.out.printf("Enter the name of your first species: ");
        String Species1 = keyboard.nextLine();
        System.out.printf("Enter the species' population: ");
        int Pop1 = keyboard.nextInt();
        System.out.printf("Enter the species' growth rate: ");
        int Growth1 = keyboard.nextInt();

        System.out.printf("Enter the name of your second species: ");
        String Species2 = keyboard.nextLine();
        System.out.printf("Enter the species' population: ");
        int Pop2 = keyboard.nextInt();
        System.out.printf("Enter the species' growth rate: ");
        int Growth2 = keyboard.nextInt();

        if (Pop2 &gt; Pop1) {
            System.out.printf("The first population must be higher. \n");
            System.exit(0);
        }


        Species input1 = new Species();
        input1.name = Species1;
        input1.population = Pop1;
        input1.growthRate = Growth1;

        Species input2 = new Species();
        input2.name = Species2;
        input2.population = Pop2;
        input2.growthRate = Growth2;

        if ((input1.predictPopulation(1) - input2.predictPopulation(1)) &lt;= 
            (input1.predictPopulation(2) - input2.predictPopulation(2))){

            System.out.printf(Species2 + " will never out-populate " + 
                              Species1 + "\n");
        }
        else {

            for (int i = 0; input2.predictPopulation(i) &lt;= 
                            input1.predictPopulation(i); i++) {

                if (input2.predictPopulation(i) == input1.predictPopulation(i)) {
                    System.out.printf(" will out-populate \n");
                }
            }
        }
    }
}
</code></pre>

<hr>

<p>This for the <code>predictPopulation()</code>:</p>

<pre><code>public int predictPopulation(int years)
    {
        int result = 0;
        double populationAmount = population;
        int count = years;
        while ((count &gt; 0) &amp;&amp; (populationAmount &gt; 0))
        {
            populationAmount = (populationAmount +
                          (growthRate / 100) * populationAmount);
            count--;
        }
        if (populationAmount &gt; 0)
            result = (int)populationAmount;

        return result;
    }
</code></pre>
