Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C++ program that reads simulated patient health information from standard input, performs a bit of analysis on that data and outputs a summary

Create a C++ program that reads simulated patient health information from standard input, performs a bit of analysis on that data and outputs a summary of the information. You must write a software program to prompt the user for two different types of patient health information: patient vital information and patient activity information.

The patient vital information consists of three pieces of information:

float temperature; unsigned int systolicPressure; unsigned int diastolicPressure; 

You should represent the patient vital information as a structure with these three members.

The patient activity information consists of two pieces of information:

unsigned int stepCount; unsigned int sleepHours; 

You should represent the patient activity information as a structure with these two members.

To simulate the memory efficiency requirements of a health device, you should use an abstract data type to hold either patient vital information or patient activity information in a memory efficient manner.

Operation

When the program starts, ask the user if they wish to:

1  Enter some patient vital information 2  Enter some patient activity information 3  Print summary information on the patient information and exit the program 

If the user wishes to enter some patient vital information, you should prompt for the three pieces of information and store that information in an array for later processing.

If the user wishes to enter some patient activity information, you should prompt for those two pieces of information and store that information IN THE SAME ARRAY for later processing.

IMPORTANT: You must not save the information in a file. You must store all the entered information in a single array. You must use a single one-dimensional array to store all the entered information, both the patient vital information and the patient activity information. Carefully consider how you can use a combination of structures and unions to achieve the objectives. You are not allowed to partition this array in some arbitrary fashion such as the even elements of the array contain patient vital information while the odd elements of the array contain patient activity data or the first 100 elements of the array contain patient vital information while the patient activity information begins at element 101. Instead, the array should hold the data in the order its entered by the user.

When the user elects to print summary information and exit the program, you should process the data in the array and output:

The number of patient vital information records.

The maximum temperature across all the patient vital information records.

The minimum temperature across all the patient vital information records.

The maximum systolic pressure across all the patient vital information

records.

The minimum systolic pressure across all the patient vital information

records.

The maximum diastolic pressure across all the patient vital information

records.

The minimum diastolic pressure across all the patient vital information

records.

The number of patient activity information records.

The total sum of step count across all the patient activity information

records.

The total sum of sleep hours across all the patient activity information

records.

IMPORTANT: You must NOT keep track of the maximum, minimum or total while accepting input from the user. Instead, you should process the contents of the array to calculate these values only after the user has elected to print the summary information and exit the program.

Ensure your program is well documented, well structured, and uses meaningful variable names. Use multiple functions as necessary for good structure and readability.

Sample Input and Output

Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 2 - Enter some patient activity information 3 - Print summary information on the patient information 
and exit the program 4 Please enter 1, 2, or 3 
Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 2 - Enter some patient activity information 3 - Print summary information on the patient information 
and exit the program x Please enter 1, 2, or 3 
Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 2 - Enter some patient activity information 3 - Print summary information on the patient information 
and exit the program 1 Enter the temperature: 98.6 Enter the systolic pressure: 100 Enter the diastolic pressure: -67 Please enter an integral unsigned number Enter the diastolic pressure: xx Please enter an integral unsigned number Enter the diastolic pressure: 80 
Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 2 - Enter some patient activity information 3 - Print summary information on the patient information 
and exit the program 2 Enter the step count: 10000 Enter the sleep hours: 7 
Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 
2 - Enter some patient activity information 
 3 - Print summary information on the patient information and exit the program 1 Enter the temperature: 96.5 
Enter the systolic pressure: 120 Enter the diastolic pressure: 82 
Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 2 - Enter some patient activity information 3 - Print summary information on the patient information 
and exit the program 1 Enter the temperature: 100.3 Enter the systolic pressure: 140 Enter the diastolic pressure: 95 
Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 2 - Enter some patient activity information 3 - Print summary information on the patient information 
and exit the program 2 Enter the step count: 2100 Enter the sleep hours: 4 
Please enter the number for the desired action (1, 2, 3): 1 - Enter some patient vital information 2 - Enter some patient activity information 3 - Print summary information on the patient information 
and exit the program 3 Number of patient vital information records: 3 
 Maximum temperature: 100.3 Minimum temperature: 96.5 Maximum systolic pressure: 140 Minimum systolic pressure: 100 Maximum diastolic pressure: 95 Minimum diastolic pressure: 80 
Number of patient activity information records: 2 
Total step count: 12100 Total sleep hours: 11 

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

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

1. Explain how business strategy affects HR strategy.

Answered: 1 week ago