Q:

checking the details of a loop results

I'm stuck trying to find how to get results when checking the results of an array.
In my array, I have three coins that when tossed, the results are either Heads or tails based on the random number returned. If the random number is less than 0.5 its heads and if > than 0.5 its Tails.
If all three tosses are < 0.5 the console should print out the "Old Yang line". Else if >0.5 then " Old Yin line ". 
how do I check through the loop to find if the results are two (<0.5) and one (>0.5) as an example?
here is my code:
public class BookOfChange {

public static void main(String[] args) {

    Coin Coin1 = new Coin();
    Coin Coin2 = new Coin();
    Coin Coin3 = new Coin();

    double firstThrow = Coin1.getFace();
    double secondThrow = Coin2.getFace();
    double thirdThrow = Coin3.getFace();
    /**
     * Test method
     */
    System.out.println(Coin1.getFace());
    System.out.println(Coin2.getFace());
    System.out.println(Coin3.getFace());

    double[] toss = {firstThrow,secondThrow,thirdThrow  };
    /**
     * Test array
     */
    System.out.println(toss);

    for(int i = 0; i < toss.length; i++)
    {
    if(toss[i]<0.5) {

        System.out.println(" Old Yang line");
    }
    else if(toss[i]>0.5) {
        System.out.println(" Old Yin line ");
    }
    }
}
}

thanks in advance

A:

Can you not just check the condition of first, second and third throw directly? See me example. 
Also you are calling System.out.println(toss), to display the elements in an Array you need to use the Arrays.toString(ArrayName) method.
if(firstThrow < 0.5 && secondThrow < 0.5 && thirdThrow < 0.5) {
    System.out.println("Old Yang line");
}
else {
    System.out.println("Old Yin line");
}

