# Help !!! need to write program asap

• 11-12-2006
Help !!! need to write program asap
hi all, im a complete newbie at this programming stuff, i am a 1st year student studying systems engineering and i need to write a program for my programming module, to calculate the mean, standard deviation and error in the mean of a set of numbers, can anyone point me in the write direction i have no idea how to do this

thanks
• 11-12-2006
Salem
Well you could start with a program which reads in a list of numbers from the user, then prints those numbers back out (just to make sure you read them OK).

Then add something to count how many numbers were input.

Then add the code to perform those calculations.
• 11-12-2006
kris.c
may be you can try this for mean , I have forgotten how do derive the SD for a given set of numbers.

Code:

```int main() {        int i=0,N=0;     float A[50],sum=0;     printf(" enter the number of terms \n");     scanf("%d",&N);     for(i=0;i<N;i++)         scanf("%f",&A[i]);         for(i=0;i<N;i++)       sum+=A[i];     mean = sum/ N;       printf( " mean = %f \n",mean);  return 0; }```
write the other two in the same manner. Dont ask for code again.
• 11-12-2006
Quote:

hi all, im a complete newbie at this programming stuff, i am a 1st year student studying systems engineering and i need to write a program for my programming module, to calculate the mean, standard deviation and error in the mean of a set of numbers, can anyone point me in the write direction i have no idea how to do this

thanks

Luckily, the right direction, is also the write direction. :) You need to begin by just writing out the step-by-simple step way that could be used to solve each of these calculations. Really do it like the computer is a complete idiot, with some uncanny numerical abilities.

That's your algorithm. Now just turn your algorithm, into code, step by step, keeping each function separate from the other - so function names like GetMean, StdDev, and StdError should be front and center, perhaps.

Look at the syntax for C in the programs in the FAQ, (and whatever books you may have on the subject), and when you get stuck, post up your code, and describe your problem, here.

Lots of people here to help you along. You just need to show your effort and be specific about the problem you're having. When you post up your code, use code tags around it - so it looks like code.