Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //calculate the amount of time
- int sum = 0;
- for(int i = 0; i < competitors.length; i++){
- sum += competitors[i];
- }
- //avg
- double average = sum / competitors.length;
- //calculate the standard deviation
- int round = 0;
- double x = 0;
- double standardDeviation;
- while(true){
- if(round == (competitors.length)){
- standardDeviation = Math.sqrt(x / competitors.length);
- break;
- }
- x = x + Math.pow(competitors[round] - average,2);
- round++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement