chapter 11 exercise 4

chapter 11 exercise 4 - { /* printf("Enter the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <stdio.h> #include "genlib.h" #include "simpio.h" #include "strlib.h" #include "math.h" double Mean(double array[], int n) double StandardDeviation(double array[], int n) int main() { printf("Enter the total number of scores to be entered: ") int n = GetInteger() double array[100] double entry = 0 printf("Enter the scores.\n") for(int i=0 i< n i++) { printf("Score %d: ", i) entry = GetReal() array[i] = entry } printf("%f\n", StandardDeviation(array, n)) } double Mean(double array[], int n)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { /* printf(&quot;Enter the total number of scores to be entered: &quot;) int n = GetInteger() double array[n] */ double total = 0 for(int j= 0 j &lt; n j++) { total += array[j] } double avg = total / n return(avg) Sheet1 Page 2 } double StandardDeviation(double array, int n) { double mean = Mean(array,n) double total=0 for(int i=0 i&lt; n i++) { total += (mean - array[i])*(mean - array[i]) } total = total / n double answer = sqrt(total) return(answer) }...
View Full Document

Page1 / 2

chapter 11 exercise 4 - { /* printf(&amp;amp;quot;Enter the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online