help with standard deviation

This is a discussion on help with standard deviation within the C Programming forums, part of the General Programming Boards category; I need help writing a program that will find the smallest, largest, average and standard deviation in a collection of ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    48

    help with standard deviation

    I need help writing a program that will find the smallest, largest, average and standard deviation in a collection of N real numbers in an input file. The value of N should not be greater than 20, and should be the first input from the file; the N numbers will be collected in an array that is built and returned from the function double *collect_N(FILE *fp, int N);. Each of 4 values, smallest, largest, average and standard deviation, computed should take this array as input (there may be other inputs to the functions) and should be computed in their own function. Any suggestions would be appreciated.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Fake: I usually suggest typing. It's easier than using magnets to flip the bits on the disk.

    For real: is there something here you have questions about? If so, what?

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,532
    > double *collect_N(FILE *fp, int N);
    Is this something you're given, or just a "gimme" to get you started on thinking about functions.

    It would be a good start to just write this function, then post what you've got.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,532
    > double *collect_N(FILE *fp, int N);
    Is this something you're given, or just a "gimme" to get you started on thinking about functions.

    It would be a good start to just write this function, then post what you've got.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 08-13-2008, 08:02 AM
  2. Standard Deviation of an array of numbers...
    By Xenofizz in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2003, 09:48 PM
  3. arrays and standard deviation
    By bruceness in forum C Programming
    Replies: 1
    Last Post: 10-28-2002, 08:35 PM
  4. Standard deviation, bubblesort and others
    By peter_pan in forum C++ Programming
    Replies: 1
    Last Post: 03-09-2002, 09:24 PM
  5. Standard Deviation in C++
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 09-14-2001, 11:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21