C++ programming Is there a formula or loop to find the median of a list ofnumber
ID: 3610900 • Letter: C
Question
C++ programmingIs there a formula or loop to find the median of a list ofnumbers? After arranging a list of values in order, the median is thevalue found in the middle. If the number of values is even, themedian will be the average of the 2 middle values C++ programming
Is there a formula or loop to find the median of a list ofnumbers? After arranging a list of values in order, the median is thevalue found in the middle. If the number of values is even, themedian will be the average of the 2 middle values
Explanation / Answer
/* The part for sorting the SalesAmounts and then finding the medianvalue is Highlighted in bold letters */ #include #include #include #include using namespace std; const int SIZE = 25; //Size of arrays int main() { double SalesAmounts [SIZE]={0.0}; //Sales amounts array string SalesReps [SIZE]; //Names of sales representativesarray ifstream infile; //Input filestream variable string fnameopen, fnameclose; //Variables to hold actualname of file double sum; int counter=0; //used in for loops double average; //average of sales amount int MaxIndex; //used to find the array with the largestvalue double LargestSale; //variable to hold the largest value coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.