SHARE
TWEET

Untitled

a guest Jun 27th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main()
  2. {
  3.     float *studentData;
  4.     int numStudents;
  5.     int size;
  6.     int average = getAverage(*array, *hours);
  7.     int median = getMedian(hours);
  8.     int mode = getMode(hours);
  9.  
  10.     cout << "How many students were surveyed?  ";
  11.     cin >> numStudents;
  12.     studentData = makeArray(numStudents);
  13.  
  14.      if (studentData == nullptr)
  15.          cout << "Error allocating memory.";
  16.      else
  17.      {
  18.          getFBData(studentData, numStudents);
  19.          selectionSort(studentData, numStudents);
  20.  
  21.          for (int i = 0; i < numStudents; i++)
  22.              cout << *(studentData + i) << endl;
  23.  
  24.          delete[] studentData;
  25.      }
  26.  
  27.      getAverage(*array, hours);
  28.      printArray(size, hours);
  29.      getMedian(*array, hours);
  30.      getMode(*array, hours);
  31.  
  32.     cout << "STATISTICS " << endl;
  33.     cout << "n  Mean: " << average;
  34.     cout << "n  Median: " << median;
  35.     cout << "n  Mode: " << mode;
  36.  
  37.  
  38.     return 0;
  39. }
  40.      
  41. int average = getAverage(*array, *hours);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top