Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3) I have written a program for you to complete. This problem is not to be included with the menu. Simply print when I run
3) I have written a program for you to complete. This problem is not to be included with the menu. Simply print when I run the menu program that it is included in another project. You are to write a program that outputs the mean, median, and modes. Your task is to complete the function. This will use structures to pass information from one function to the print function. using this part of the code i want write a c++ code that cab get the same output that is give down here
Stats *stat(const Array *array){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//Non-working stub to be completed by the student | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cout< | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Stats *stats=new Stats; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stats->mode=new Array; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stats->mode->size=0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
int nModes=0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stats->mode->data=new int[nModes]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stats->modFreq=1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stats->median=0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return stats; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I have also supplied the expected outputs you can compare against in a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
StatResults.txt file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started