- #1
Arnoldjavs3
- 191
- 3
Homework Statement
Hi, I am currently in a C programming course and i have no background knowledge of programming whatsoever. The professor in my course isn't very good at explaining so I'm a bit lost here. (Please keep in mind, I am NOT asking anyone to do this for me. I would like to know a good approach on how to tackle these assignments.)
The variance (SD2 ) of a number (N) of scores in a population tells us how spread out the scores (X’s) are around the mean of the scores (M). The variance is the average of the squared deviations from the mean or the standard deviation squared and thus, the reason the symbol SD2 is used to represent variance. The standard deviation (SD) is the square root of the variance. The variance is the average of each score’s squared difference from the mean. The formulas for the variance (SD2 ) and the standard deviation (SD) are given below. Variance = SD2 = ∑(X – M)2 / N Standard Deviation = SD = √SD2
Note that the variance formula used in this assignment is the exact number of scores N and not N – 1 that may be used in some variance formulas found elsewhere. Also, in C, you can use the built-in function sqrt(M) to get the square root of M and you can simply multiply a number M by itself to get the square of M or M2 .
1. Write an algorithm and a program that reads five given real scores and computes the variance and standard deviation of 5 given scores and displays the following:
i. For each input score, a row showing the Score (X), the Mean Score (M), deviation score (X – M) and squared deviation score (X – M)2 .
ii. A row showing the sum of deviation squared ∑(X – M)2 .
iii. A row showing the Variance (SD2 ) of the scores
. iv. A row showing the standard deviation (SD) of the scores.
Note that the variance formula used in this assignment is the exact number of scores N and not N – 1 that may be used in some variance formulas found elsewhere. Also, in C, you can use the built-in function sqrt(M) to get the square root of M and you can simply multiply a number M by itself to get the square of M or M2 .
1. Write an algorithm and a program that reads five given real scores and computes the variance and standard deviation of 5 given scores and displays the following:
i. For each input score, a row showing the Score (X), the Mean Score (M), deviation score (X – M) and squared deviation score (X – M)2 .
ii. A row showing the sum of deviation squared ∑(X – M)2 .
iii. A row showing the Variance (SD2 ) of the scores
. iv. A row showing the standard deviation (SD) of the scores.
I really don't understand what to do here. I don't even understand what's going on, its our second class so far and she hasn't taught us anything aside from general information of how computers evolved, so I have no idea how to program. The course is apparently "for beginners who have no background knowledge" (namely me). But simply put, this is our first introduction to programming. Again, she has not taught a single thing about programming, not even the basics.
Homework Equations
?
The Attempt at a Solution
Questions:
1) When it asks you to write an algorithm, does this mean the general methods and sequence they should be executed to solve the problem? So am I to solve the problem literally through mathematical means and then simply put them in a document? Or is there more programming involved here
2) Am I supposed to know how to code this? Is there a general approach here that I'm missing?
I apologize for the wall of text. Again, any help is appreciated. I'd just like some light shed for this so I can do the assignments in the future properly.