In: Computer Science
Using (C programming language)
Create a health monitoring program, that will ask user for their name, age, gender, weight, height and other health related questions like blood pressure and etc.
Based on the provided information, program will tell user BMI, blood pressure numbers if they fall in healthy range or not and etc.
Suggestions can be made as what should be calorie intake per day and the amount of exercise based on user input data. User should be able to insert height either in cm or inches and weight can be either in kgs or lbs.
Some information on Blood pressure:
Elevated blood pressure: Diastolic < 80 and Systolic between 120 and 129
Stage 1 Hypertension: Diastolic between 80 and 89, or Systolic between 130 and 139
Stage 2 Hypertension: Diastolic 90 or greater, Systolic 140 or greater
Danger Zone: Stage 2 Hypertension, but Diastolic 120 or greater, or Systolic 180 or greater
Hypotension: Diastolic 60 or lower, Systolic 90 or lower
Other quantities can be:
Pulse, body temperature
Health Monitoring Program using C
The given below program is a health monitoring program through which the user can enter the health coditions and other details and based on that, the system will provide suggestions and remarks and also it will tell the current health state of the user and , if or not he requires immediate health care.
In this program, we will ask the user to enter all their details and health related details, Then the system stors the details and checks for various diseases and other stuff.
Given Below is the code :
#include<iostream.h>
void main() //main function.Execution starts
{
char name,gender; //Declearing the required varibles
int age,weight,height,a,pulse;
printf("Enter the name of the patient"); //Getting the details of the patient.
scanf("%s",&name);
printf("enter the age of the patient");
scanf("%d",&age);
printf("enter the Gender of the patient");
scanf("%s",&gender);
printf("Enter the height in centemeters");
scanf("%d",&height);
printf("enter the weight");
scanf("%d",&weight);
printf("The Details of %s are :",name); //Displaying the details to the patient/
printf("Age : %d",age);
printf("Gender :%s",gender);
printf("Height :%d",height);
printf("Weight :%d",weight);
printf("Enter The Blood pressure details"); //Getting the blood pressure details.
printf("Enter the diastolic value"); //getting diastotic value
scanf("%d",&diastolic);
printf('enter the systolic value"); getting the systolic value
scanf("%d",&systolic);
if((diastolic<80)&&((systolic>120)&&(systolic<129))) //Checking for elivated BP condition.
{
printf("Having Elivated Blood Pressure");
}
else if((diastolic>80)&&(diastolic>89) &&
((systolic>130)&&(systolic<139)))
{ //Checking for Hypertension Condition.
printf("Stage 1 Hypertension");
else if (diastolic>90&&systolic>140)
{
printf("Stage 2 HyperYension");
}
else
{
printf("the patient is in danger zone and admit to a hospital Immediately");
}
Printf("Calorie Intake"); // Food control.
a=height-100;
if(a>weight) //Checking whether height - 100 is the weight
{
printf("you are overweight")
Printf("Your Calorie intake should be 800-1200K"); //Displaying calorie intake
}
else
{
printf("you are balenced");
printf("Calorie Intake can be 1500-2000k");
}
printf("enter the Pulse rate"); //Checking the pulse rate
scanf("%d",&pulse);
if((pulse>60)&&(pulse<90)) //Checking whether rate between normal boundaries
{
printf("pulse rate normal");
}
else
{
printf("Pulse rate high");
}
}
Note : Read the inline comments and understand the program.Thank You.