Question: NEED IT QUICK PLEASE Write a C program that calculates the mean, median and mode of a given array in the following manner: i) Write
NEED IT QUICK PLEASE
Write a C program that calculates the mean, median and mode of a given array in the following manner:
i) Write three functions mean (), median () and mode () that calculates the mean, median and mode of an array.
ii) Using these functions write a program that calculates all the three above mentioned values for two different arrays A and B where A is an array that contains the number of hours spent by a person each day for playing video games and B is an array that contains the number of hours spent by a person each day for his studies.
iii) Based on the above mentioned values that you calculate using these functions compare the values obtained from both the arrays. If all the three values of array A is greater than array B print statement that warns the person to study. If all the three values of array B is greater than array A print statement that praises him for his studies. If all the three values are equal print statement that tells him he is well balanced. If any other issues, print "Sorry can't come to an outcome". Example: Let array A be: 4 5 5 2 8 9 Let array B be: 2 3 1 4 8 4 Mean of A is: 5.5 Median of A is: (5+2)/2=3.5 Mode of A is: 5 Mean of B is: 3.6 Median of B is: (1+4)/2=2.5 Mode of B is: 4 Here Mean, Median and Mode of A is larger than B. Therefore we print "You're playing more video games you have to spent more time studying". In case if Mean, Median and Mode of A is lesser than B then you print "Good, you're spending considerable time in studying".(input from the user).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
