Functions and Arrays (C)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BelleBaby
    New Member
    • Mar 2008
    • 5

    Functions and Arrays (C)

    I have an assignment that I think I more or less understand, but I am lost on how to use functions correctly. As well, we are to include an array that I have no clue how to do.


    here is the equation we need to use: x (+-) z o/sqrtN
    o = standard deviation
    x = sample mean
    N = number of samples in the population
    z = critical point for the confidence level

    The most comment values of z are given below:
    Confidence level p z
    90% 0.05 1.645
    95% 0.025 1.960
    99% 0.005 2.576
    (I don't know if that part is extremly relevant right now but I included it just in case)

    It then says write a program to calculate the confidence interval of the following database. (then it gives 12 different numbers.)

    My problem is that I have no clue how to include an array (tried it in another assignment but didn't get it). and I don't know how to properly work a function.

    Anything that could get me started would be a big help. I can manage writing a skeleton for this project if I know how to go about using an array and function.

    Thank you in advance
  • Meetee
    Recognized Expert Contributor
    • Dec 2006
    • 928

    #2
    Originally posted by BelleBaby
    I have an assignment that I think I more or less understand, but I am lost on how to use functions correctly. As well, we are to include an array that I have no clue how to do.


    here is the equation we need to use: x (+-) z o/sqrtN
    o = standard deviation
    x = sample mean
    N = number of samples in the population
    z = critical point for the confidence level

    The most comment values of z are given below:
    Confidence level p z
    90% 0.05 1.645
    95% 0.025 1.960
    99% 0.005 2.576
    (I don't know if that part is extremly relevant right now but I included it just in case)

    It then says write a program to calculate the confidence interval of the following database. (then it gives 12 different numbers.)

    My problem is that I have no clue how to include an array (tried it in another assignment but didn't get it). and I don't know how to properly work a function.

    Anything that could get me started would be a big help. I can manage writing a skeleton for this project if I know how to go about using an array and function.

    Thank you in advance
    I have some doubts regarding your problem statement. The equation given (x (+-) z o/sqrtN ) is to find confidence interval? Anyways if it is so and numbers given in database gives the value of N then you can take the array of N and can store the values in that array.

    I think you have not given the complete statement but still you can make a function with parameters passed to find the ultimate equation value.

    Hope it helps!
    Regards

    Comment

    • sicarie
      Recognized Expert Specialist
      • Nov 2006
      • 4677

      #3
      I'd also recommend the cplusplus.com's data type tutorial as well as their functions tutorial .

      Comment

      Working...