//this program reads a list of blood pressures for several patients.
//It then sorts them according to systolic, diastolic, and pulse pressures.
//After sorting, it prints the patients from each list with the highest pressures.
#include <iostream>
using namespace std;
//global constants
const int NUMBER_OF_PATIENTS=10;
const int NUMBER_IN_DANGER=5;

//data types
struct bloodType
    int ID;
    int systolic;
    int diastolic;
    int pulse;
enum pressType {SYS,DIA,PUL};

void readData(bloodType[]);
void sortData(bloodType[],pressType);
void printData(bloodType[]);

int main()
    pressType i;
    bloodType patientList[NUMBER_OF_PATIENTS];
    return 0;

//Read systolic and diastolic pressures for each patient on the list.
//Calculate pulse pressure as the difference between systolic and diastolic.
//Assign patient ID numbers consecutively.
void readData(bloodType patientList[NUMBER_OF_PATIENTS])
    int i;
    for (i=1;i<=NUMBER_OF_PATIENTS;i++)
        cout <<"please enter the systolic and diastolic pressures for patient "<<i<<endl;

//Sort the list of patients in descending order by the pressure specified in whichPressure
//This function uses Bubble Sort.
void sortData(bloodType patientList[NUMBER_OF_PATIENTS],pressType whichPressure)
    int i,last;
    bloodType temp;
    bool outOfOrder;
            switch(whichPressure)//which field am I sorting by?
                case SYS:
                case DIA:
                case PUL:

//Print the blood pressure data from the top few patients in the list.
void printData(bloodType patientList[NUMBER_OF_PATIENTS])
    int i;
    cout<<"ID systolic diastolic pulse\n";
    for (i=0;i<=NUMBER_IN_DANGER-1;i++)
        cout<<patientList[i].ID<<" "<<patientList[i].systolic
            <<" "<<patientList[i].diastolic<<" "<<patientList[i].pulse<<endl;