Question: Draw a flowchart for this program source code in C: #include #include #define SIZE 9 9 int main ( ) { int data [ SIZE
Draw a flowchart for this program source code in C:
#include
#include
#define SIZE
int main
int dataSIZE
;
printfThis program calculates and displays the mean, median, mode, and the frequency of the mode for a given set of data items.
;
printfGiven the following data points stored in an array:
;
for int i ; i SIZE; i
printfd datai;
if i SIZE
printf;
if i Print newline every elements
printf
;
printf
;
double sum ;
Sort the array for median and mode calculation
for int i ; i SIZE ; i
for int j ; j SIZE i ; j
if dataj dataj
int temp dataj;
dataj dataj ;
dataj temp;
Mean calculation
for int i ; i SIZE; i
sum datai;
double mean sum SIZE;
Median calculation
double median;
if SIZE
median dataSIZE dataSIZE ;
else
median dataSIZE ;
Mode calculation
int mode data modeFrequency tempFrequency ;
for int i ; i SIZE; i
if datai datai
tempFrequency;
else
if tempFrequency modeFrequency
modeFrequency tempFrequency;
mode datai ;
tempFrequency ;
Check for the last value
if tempFrequency modeFrequency
modeFrequency tempFrequency;
mode dataSIZE ;
printfThe mean average is: f
mean;
printfThe median middle value is: f
median;
printfThe mode most frequent value is: d
mode;
printfThe frequency of the mode is: d
modeFrequency;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
