/* Java application illustrating the use of objects of the TossableCoin3 class. */ public class TossableCoin3App { public static void main(String[] args) { // Create a new coin object and assign it to variable 'coin'. // Notice the specified "heads probability". TossableCoin3 coin = new TossableCoin3(0.35); // Toss the coin several times, each time displaying the result. for (int i=1; i <= 20; i = i+1) { coin.toss(); System.out.println(coin); } // Report how many times each of HEADS and TAILS was tossed. System.out.println("\n# times coin was tossed: " + coin.tossCount()); System.out.println("# times Heads was tossed: " + coin.headsCount()); System.out.println("# times Tails was tossed: " + coin.tailsCount()); } }