#include #include #include "cplex.h" #include "inssort.h" #include "p3.h" void main (void) { int intarray[50]; // Integer array double dblarray[50]; // Double array cplex cplexarray[50]; // Complex array bigint bigarray[50]; // Big number array int icount, // Number of integers dcount, // Number of doubles ccount, // Number of complex values bcount; // Number of bigint values fstream f; // File istream object int j; // Loop control variable char fname[30]; // File name cout << "Enter the data file name: "; cin >> fname; f.open (fname, ios::in); // Open the data file if (f.fail()) { cout << "Problem opening file\n"; return; } f >> icount; // Read integers for (j = 0; j < icount; j++) f >> intarray[j]; f >> dcount; // Read doubles for (j = 0; j < dcount; j++) f >> dblarray[j]; f >> ccount; // Read complexes for (j = 0; j < ccount; j++) f >> cplexarray[j]; f >> bcount; // Read bigint numbers for (j = 0; j < bcount; j++) f >> bigarray[j]; f.close(); InsertionSort (intarray, icount); // Sort each array InsertionSort (dblarray, dcount); InsertionSort (cplexarray, ccount); InsertionSort (bigarray, bcount); cout << "\nFor the integer values:\n"; // Output low, median, and MedianRange (intarray, icount); // high for each array cout << "\nFor the double values:\n"; MedianRange (dblarray, dcount); cout << "\nFor the complex values:\n"; MedianRange (cplexarray, ccount); cout << "\nFor the big values:\n"; MedianRange (bigarray, bcount); }