Answered step by step
Verified Expert Solution
Question
1 Approved Answer
original code template on left. solve for #1 please ivargas8 / exam-1-practical-ivar... Run 8+ Share + main.c E Console Shell Markdown Files 0 O IIILIuue
original code template on left. solve for #1 please
ivargas8 / exam-1-practical-ivar... Run 8+ Share + main.c E Console Shell Markdown Files 0 O IIILIuue \UTTI18 Il/ 9 Preview of README.md m 10 int main(void) { 11 Problem 1: Blood Pressure 12 13 int opt; printf("Enter 1 to test P1, 2 to test P2, 3 to test P3: "); scanf("%d", &opt); 14 S 15 Do you know about Blood Pressure? It is one of those measurements you get at a clinic or the hospital, and is used to monitor your cardiovascular health. Hypertension can be a sign of many issues, so it is important to identify whether a reading belongs to one of multiple categories. 16 if(opt == 1) { 17 18 ************ ... ******************** 19 Problem 1: Blood Pressure ******** *******/ R. 20 21 22 Blood pressure is measured with two numbers: Systolic Pressure, or the pressure when the heart pumps blood through the arteries, and Diastolic Pressure, which is the pressure of the blood in between heartbeats. The following chart, taken from The American Heart Association website, shows the measurements and the categories they belong to: // TODO: Fix the code below. // HINT: The code doesn't need big changes. Review the conditions and the outputs carefully. int sysP, diasp; 23 24 25 26 CATEGORY SYSTOLIC DIASTOLIC // Read Systolic and Diastolic pressure scanf("%d %d", &sysP, &diasp); 27 28 Normal = 140 or >= 90 34 35 Hypertensive Crysis >= 180 and/or >= 120 36 if(sysP 140 && diasp > 90) { printf("Stage 2 Hypertension "); } else { printf("Hypertensive Crysis "); } 37 ERROR = Systolic 38 39 40 41 Inside main.c you will find code that compiles and runs normally, but its output does not match the table above. 42 43 You have to correct it, making sure it compiles, runs, and functions exactly as expected. 44 45 /* Problem 1 End */ } else if(opt 2) { 46 == Grading Rubric 47Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started