I cannot for the life of me figure out why headsPercentage and tailsPercentage always = 0! I've debugged step by step and totalNumberOfHead, totalNumberOfTails, and totalNumberOfTosses are never 0.
So why are the percentages always 0!?

import java.util.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Cameron
*/
public class TossSimulation {
/*
* This method randomly genrates X number of coin tosses depending on the
* number passed to the method and stores the results in the tossResults
* array as booleans. True (1) being heads, and False (0) being tails.
* The method returns the integer heads which will be used to calculate
* the number of heads and tails (tails = numberOfTosses - heads) as well
* as display them.
*/
public Integer simulateTosses(int numberOfTosses) {
//Creating the integer to track the number of results for heads
int heads = 0;
//Creating the array used to store the results and giving it dimensions.
Boolean[] tossResults;
tossResults = new Boolean[numberOfTosses];
//Creating a random number generator and initializing it.
Random rand;
rand = new Random();
//Setting the Random number generators seed.
rand.setSeed(System.currentTimeMillis());
//Simulating the coin tosses.
for (int W = 0; W < numberOfTosses; W++) {
//Storing the result in the array at the correct index
tossResults[W] = rand.nextBoolean();
}
//Go through the array 1 by 1 and add 1 to heads everytime a
//value is true.
for (int X = 0; X < numberOfTosses; X++) {
//If the result is true (heads) add one to heads
if (tossResults[X] == true) {
heads++; //Adding one to heads
}
}
return heads; //Return heads to the caller
}
}

Code :

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Cameron
*/
public class InputValidation {
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
*This method checks if the string passed to the method is not a number
*Web Page Used: http://www.javadb.com/validate-if-string-is-a-number
*/
public boolean isNaN(String textField) {
try {
//try parsing the numbers
Double.parseDouble(textField);
Short.parseShort(textField);
//If an error occurs catch it and return a bool of true meaning it is not a number
} catch (NumberFormatException ex) {
return true;
}
//Else if return false meaning no erros = it IS a number
return false;
}
}

Also when trying to generate the Javadoc files for this project I get: