chapter 11 exercise 4

# chapter 11 exercise 4 - printf"Enter the total number...

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

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)

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { /* printf("Enter the total number of scores to be entered: ") int n = GetInteger() double array[n] */ double total = 0 for(int j= 0 j < 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< n i++) { total += (mean - array[i])*(mean - array[i]) } total = total / n double answer = sqrt(total) return(answer) }...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

chapter 11 exercise 4 - printf"Enter the total number...

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

View Full Document
Ask a homework question - tutors are online