vey data analysis, that can compute the mean, median and mode of the data. Refer to fig 6.16 as reference

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a C program for survey data analysis, that can compute the mean, median and mode of the data.

Refer to fig 6.16 as reference 

Write a program for survey data analysis, that can
compute the mean, median and mode of the data. Refer
to figure 6.16 as reference.
Please submit at least two files, one Word file having the
code and the result of your code. Another is your c
source file.
Transcribed Image Text:Write a program for survey data analysis, that can compute the mean, median and mode of the data. Refer to figure 6.16 as reference. Please submit at least two files, one Word file having the code and the result of your code. Another is your c source file.
47
48
49
50
51
52
53
54
55
56
57
58
59
60 /* sort array and determine median element's value */
61 void median(int answer [])
62
{
63
64
/* total response values */
for (j = 0; j < SIZE; j++ ) {
total + answer[j];
} /* end for */
65
66
67
68
69
70
71
72
73
74
75
76
77
printf("The mean is the average value of the data\n"
"items. The mean is equal to the total of\n"
"all the data items divided by the number\n"
"of data items (%d). The mean value for\n"
"this run is: %d/%d = %.4f\n\n",
SIZE, total, SIZE, ( double ) total / SIZE );
} /* end function mean */
拜安安安安安安伯公里。 " Median", 并安安安安安安安林;
"The unsorted array of responses is" );
printArray( answer ); /* output unsorted array */
bubbleSort( answer ); /* sort array */
Fig. 6.16 Survey data analysis program. (Part 3 of 8.)
printf("\n%s\n%s\n%s\n%s",
©1992-2010 by Pearson Education, Inc. All Rights Reserved.
printf("\n\nThe sorted array is" );
printArray( answer ); /* output sorted array */
/* display median element */
printf("\n\nThe median is element %d of\n"
"the sorted %d element array.\n"
"For this run the median is %d\n\n",
SIZE / 2, SIZE, answer[ SIZE / 2 ] );
78
79
80
81
/* determine most frequent response */
82 void mode(int freq[], const int answer [])
83
{
84
85
86
87
88
89
90
91
92
} /* end function median */
int rating; /* counter for accessing elements 1-9 of array freq */
int j; /* counter for summarizing elements 0-98 of array answer */
int h; /* counter for diplaying histograms of elements in array freq */
int largest = 0; /* represents largest frequency */
int modeValue = 0; /* represents most frequent response */
printf("\n%s\n%s\n%s\n",
林公安窃窃窃窃窃窃群,
Mode", "********");
Fig. 6.16 Survey data analysis program. (Part 4 of 8.)
Transcribed Image Text:47 48 49 50 51 52 53 54 55 56 57 58 59 60 /* sort array and determine median element's value */ 61 void median(int answer []) 62 { 63 64 /* total response values */ for (j = 0; j < SIZE; j++ ) { total + answer[j]; } /* end for */ 65 66 67 68 69 70 71 72 73 74 75 76 77 printf("The mean is the average value of the data\n" "items. The mean is equal to the total of\n" "all the data items divided by the number\n" "of data items (%d). The mean value for\n" "this run is: %d/%d = %.4f\n\n", SIZE, total, SIZE, ( double ) total / SIZE ); } /* end function mean */ 拜安安安安安安伯公里。 " Median", 并安安安安安安安林; "The unsorted array of responses is" ); printArray( answer ); /* output unsorted array */ bubbleSort( answer ); /* sort array */ Fig. 6.16 Survey data analysis program. (Part 3 of 8.) printf("\n%s\n%s\n%s\n%s", ©1992-2010 by Pearson Education, Inc. All Rights Reserved. printf("\n\nThe sorted array is" ); printArray( answer ); /* output sorted array */ /* display median element */ printf("\n\nThe median is element %d of\n" "the sorted %d element array.\n" "For this run the median is %d\n\n", SIZE / 2, SIZE, answer[ SIZE / 2 ] ); 78 79 80 81 /* determine most frequent response */ 82 void mode(int freq[], const int answer []) 83 { 84 85 86 87 88 89 90 91 92 } /* end function median */ int rating; /* counter for accessing elements 1-9 of array freq */ int j; /* counter for summarizing elements 0-98 of array answer */ int h; /* counter for diplaying histograms of elements in array freq */ int largest = 0; /* represents largest frequency */ int modeValue = 0; /* represents most frequent response */ printf("\n%s\n%s\n%s\n", 林公安窃窃窃窃窃窃群, Mode", "********"); Fig. 6.16 Survey data analysis program. (Part 4 of 8.)
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY