![]() ![]() ![]() ![]() Maximum = counter // Set counter to the maximum appearance value. Create a loop to loop through the pointer array values for ( int i = 0 i maximum) Int counter // To hold the value of number of appearances int maximum = 0 // To hold the value of maximum number of appearances int *mode You print array twice (before and after sorting) with for loops. No needs to read array values again and again in every function. If the maximum number of appearances is 1 then return -1 if (maximum = 1) You need special module (or function) to get array values then find and print mean, median and mode of this array by separate functions. Make mode point to the current modeĬout << "The value of j is: " << j << "\nThe value of the pointer is: " << *(Array j) << endl Ĭout << "The value of counter is: " << counter << endl Make each // element point to an element in the donations array. Each element of arrPtr is a pointer to int. Function prototypes void arrSelectSort( int *, int) Ĭonst int NUM_DONATIONS = 15 // Number of donations // An array containing the donation amount. This program displays the mode of a set of values. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |