454,650 Members | 1,388 Online
Need help? Post your question and get tips & solutions from a community of 454,650 IT Pros & Developers. It's quick & easy.

# Population Standard Deviation - java

 P: 1 Hello! So i am a new programmer and i really need some help. I am trying to find the Population Standard Deviation of 7 numbers which the user inputs. Please see below my Expand|Select|Wrap|Line Numbers         double dayOne, dayTwo, dayThree, dayFour, dayFive, daySix, daySeven, avgRain = 0, stanDeviation = 0, dayOneSq = 0, dayTwoSq, dayThreeSq, dayFourSq, dayFiveSq, daySixSq, daySevenSq, avgRainSq;              //Get rainfall information from users.           System.out.println("Enter rainfall measurement for Day 1 (in mm): ");         dayOne = reader.nextDouble();           System.out.println("Enter rainfall measurement for Day 2 (in mm): ");         dayTwo = reader.nextDouble();   Etc, Etc.        //find average   avgRain = (dayOne + dayTwo + dayThree + dayFour + dayFive + daySix + daySeven)/7;        // calculate population deviation           dayOneSq = (dayOne - avgRain);               Math.pow(2,dayOneSq);           dayTwoSq = (dayTwo - avgRain);             Math.pow(2,dayTwoSq);           etc..etc...           //find standard deviation           avgRainSq = (dayOneSq + dayTwoSq + dayThreeSq + dayFourSq + dayFiveSq                         + daySevenSq)/7;           stanDeviation = (Math.sqrt(avgRainSq));     System.out.printf (", Standard Deviation: %.4f\n\n",stanDeviation); any hint would be fantastic!! Thanks!!! Aug 5 '13 #1