Question: Construct a C++ program that reads and processes all records in a file (patient3E.dat) containing first name, last name, blood pressure (systolic/diastolic) and a room

Construct a C++ program that reads and processes all records in a file (patient3E.dat) containing first name, last name, blood pressure (systolic/diastolic) and a room number. Based on the criteria below, create output to the screen that reports which category each patient is in based on pressure readings.

Input Data

The Patient3E.dat contains a one record per line with a space character delimiting each field. The data is organized as firstname, last name, blood pressure and room number

Because the data in the file is largely space delimited, you should be able to read the data file with simple stream techniques ( >> ) and should not need to resort to the more elaborate extraction and string processing used in Program #2. Use the Priming Read logic to process all records in the file. If you choose to use a diagnostic log file, name it P3.log.

Example input file Patient3E.dat

Eleanore Smith 110/73 120

Willie Makeit 122/84 124

Martinez Martinez 125/92 134

Tom Jones 200/78 121

Ima Phinnishet 208/116 132

Processing

Your program should categorize each patients blood pressure based on the following standard. Create a report like the following based on the data found in the input file. Add a \"+\" in front of any systolic value which is out of normal range and a \"+\" after any diastolic value which is out of range. The Notes column should be a series of 0-3 asterisks based on severity of diagnosis. Write the report to a file named P3.out. Screen output is optional.

Note Room Name BP Diagnosis

---- ---- ------------------------ --------- ---------------

120 Smith, Eleanor 110/73 Normal

* 124 Makeit, Willie 122/84+ Prehypertension

** 134 Martinez, Maria 125/92+ Stage 1 High

*** 121 Jones, Tom +200/78 Stage 2 High

*** 132 Phinnishet, Ima +208/116+ Stage 2 High

Summary

Count Diagnosis

----- -------------------

1 Normal

1 Prehypertension

1 Stage 1 High

2 Stage 2 High

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!