Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(a) Write a function bp(s,d) which takes systolic and diastolic pressure values

ID: 2985710 • Letter: #

Question

(a) Write a function bp(s,d) which takes systolic and diastolic pressure values and returns returns
a list of 2 categorizations (each with a numerical value 0-6). Use a 0 for any invalid inputs!
systolic (mmHg) diastolic (mmHg)
1 Hypotension 0-89 0-59
2 Desired 90-119 60-79
3 Prehypertension 120-139 80-89
4 Stage 1 Hypertension 140-159 90-99
5 Stage 2 Hypertension 160-179 100-109
6 Hypertensive Crisis 180 110
For example, bp(128,98) should return the list [3,4], and bp(-54,32) should return [0,1].

Explanation / Answer

int bp(int s, int d){ int x[2]; int index=0; if(s>=0 && s=0 && d=90 && s=60 && d=120 && s=80 && d=140 && s=90 && d=160 && s=100 && d 180 || d < 0 || d > 110){ x[index]=0; } return x; }