Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All you need to do is fill in the ??? and finish the implementation of the two functions. The function AbnormalCategory will iteratively go through

All you need to do is fill in the ??? and finish the implementation of the two functions.

The function AbnormalCategory will iteratively go through each patient and find the patient who has either the highest or lowest value of a particular category of interest. One of the parameters of this function is to know the category of interest (weight, height, temp, etc.) and if were trying to find the MAX/MIN of that category. Thus, your function should return the MAX/MIN value found and arrayPtr should be updated to point the patient (row [base address of the sub-array]) who has the MAX/MIN value.

The function DisplayPatientInfo will display the entire record of the patient through arrayPtr, which has been updated by AbnormalCategory. Think of it as displaying an entire row (one-dimensional array) of a two-dimensional array. Just before you display the patients record, youll display a header, so we know what the corresponding values represent.

Sample executable:

ID# Height Weight Temp Pulse Calcium Potassi Sodium 7 73 183 94.2 36 9.1 3.8 144

Patient has a min Temp of 94.2

Code:

patientAnalysis.cpp

#include #include using namespace std;

// constants const int NUM_PATIENTS = 10; const int NUM_CLINICAL_DATA = 8;

// function prototypes ??? DispPatientInfo(???); ??? AbnormalCategory(???);

// ==== main ================================================================== // // ============================================================================

int main() { // declare variables double patientData[NUM_PATIENTS][NUM_CLINICAL_DATA] =

{ {1, 67, 147, 101.1, 79, 8.8, 3.5, 141}

, {2, 66, 270, 103.9, 120, 8.4, 3.7, 136}

, {3, 78, 232, 104.7, 49, 9.7, 5.2, 143}

, {4, 69, 284, 100.3, 104, 9.4, 3.8, 142}

, {5, 75, 215, 99.9, 45, 9.5, 4.9, 137}

, {6, 63, 155, 97.4, 90, 10.1, 3.7, 140}

, {7, 73, 183, 94.2, 36, 9.1, 3.8, 144}

, {8, 65, 180, 102.1, 102, 9.6, 4.8, 138}

, {9, 76, 152, 95.6, 96, 8.6, 4.2, 145}

, {10, 71, 213, 98.2, 92, 10.2, 3.9, 135}

};

string heading[NUM_CLINICAL_DATA] =

{ "ID#" // ID # of the patient

, "Height" // Height in inches

, "Weight" // Weight in pounds

, "Temp" // Temperature in Fahrenheit

, "Pulse" // Pulse Per Minute

, "Calcium" // Calcium Levels

, "Potassi" // Potassium Levels

, "Sodium" // Sodium Levels

};

double *arrayPtr;

double value;

bool max;

int catInterest; // category of interest

// [2 through NUM_CLINICAL_DATA - 1]

// Assign values to variables

catInterest = 3; // interested in Temperature

max = false; // True means find the max. False means find min.

value = AbnormalCategory(patientData, NUM_PATIENTS, &arrayPtr,

catInterest, max);

// Display Data DispPatientInfo(arrayPtr, NUM_CLINICAL_DATA, heading);

if (max) { cout << " Patient has a max " << heading[catInterest] << " of " << value << endl << endl; } else { cout << " Patient has a min " << heading[catInterest] << " of " << value << endl << endl; }

return 0;

} // end of "main"

// ==== DispPatientInfo =======================================================

//

// This function displays the patient's record

//

// Input:

//

// ???

//

// Output:

// ???

//

// ============================================================================

// ==== AbnormalCategory ======================================================

//

// This function goes through all the patients records and finds the patient

// who has the MAX or MIN amount of a particular category of interest. That

// interest could be their weight, height, et cetera. The function returns the

// value of interest.

//

// Input:

//

// ???

//

// Output:

// ???

//

// ============================================================================

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books