₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,324,984 members, 8,419,826 topics. Date: Thursday, 04 June 2026 at 12:17 AM

Toggle theme

Please HELP Me With This Java Program - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingPlease HELP Me With This Java Program (1775 Views)

1 Reply (Go Down)

Please HELP Me With This Java Program by Vectormike(op): 11:19am On Jun 09, 2017
Write a Java program to calculate mean and standard deviation of 20 numbers
Re: Please HELP Me With This Java Program by Nobody: 2:42pm On Jun 09, 2017
Vectormike:
Write a Java program to calculate mean and standard deviation of 20 numbers
I even have an assignment on this too
Re: Please HELP Me With This Java Program by Sirnuel: 2:07pm On Jun 10, 2017
/**
* Method to get the mean of n numbers
* @param numbers - array of numbers
* @return computed mean
*/
public static double getMean(double [] numbers){
double sum = 0;
double mean = 0.0;

//return 0 if there is no number
if(numbers.length < 1)
return 0.0;

//get the sum of the numbers
for(int i = 0; i < numbers.length; i++){
sum = numbers[i] + sum;
}

//calculate the mean
mean = sum/numbers.length;

return mean;
}

/**
* Method to return the standard deviation of n numbers
* @param numbers - a double[] array of numbers
* @return computed standard deviation
*/

public static double getStandardDeviation(double [] numbers){
//Instantiate variables
double sum = 0;
double mean = 0.0;
double variance = 0.0;
double standardDeviation = 0.0;

if(numbers.length < 1)
return 0.0;

//calculate the mean
//return 0 if there is no number
if(numbers.length < 1)
return 0.0;

//get the sum of the numbers
for(int i = 0; i < numbers.length; i++){
sum = numbers[i] + sum;
}

//calculate the mean
mean = sum/numbers.length;

//reset sum to 0;
sum = 0;
//using the computed mean, calculate for the standard deviation
for(int n = 0; n < numbers.length; n++){
double temp = Math.pow(numbers[n] - mean, 2);
sum = temp + sum;
}

//calculate the varianceb
variance = sum/numbers.length;

//calcualte the standard deviation
standardDeviation = Math.sqrt(variance);

return standardDeviation;
}
Re: Please HELP Me With This Java Program by kevindd: 8:07pm On Jun 28, 2017
I have been trying to learn Java for a long time but can't handle it, unfortunately... Now I need to create a web app for my business website and I am looking for some good developers currently. I guess I will use the help of the developers from https://www.issart.com/en/lp/java-development-team/java-expertise/se for this job. They seem to be nice specialists. Maybe you guys can help me with it too?
Re: Please HELP Me With This Java Program by Dangujba1111: 5:48am On Jun 30, 2017
I wrote this for school assignment it has GUI where you put any number call me to know where i can share it for you 07032966865
Re: Please HELP Me With This Java Program by MediaTools: 4:57pm On Jun 04, 2020
Use this mean calculator to compute the arithmetic mean from a set of numerical values. Data is from: Population Sample Enter comma separated data
1 Reply

How To Compile And Run Java Program By NotepadHelp Me Solve This Java Regex Problem234

Data Analyst Or Web Developer. Which Should One Start First.Meet Tayo, The Yoruba Boy Introduced By ZuckerbergIs Seunthomas A Blogger Or Programmer?