write a structure that assigns the value of low to the variable name pressure if
ID: 3706079 • Letter: W
Question
write a structure that assigns the value of low to the variable name pressure if the variable blood pressure is less than 68 and it is signs not low to pressure if it is 6
urses/1466534/quizzes/2326306/take Question 26 10 pts Write a structure that assigns the value of "low" to the variable named pressure if the variable bloodPressure is less than 68 and it assigns "not low" to pressure if it is 68 or above Then display the result to the screen with a messge that tells the user Your blood pressure is " and then the value. Just create the pseudocode for the structure, not the whole program. Put a ; after each line of code so I can easily parse the statements in a word processor HTML Editor ParagraphExplanation / Answer
Please find below the solution.
Please find explanation in the comments.
public class BloodPressure {
public static void calculateBloodPressure(int pressure) {
//declaring variable bloodPressure
String bloodPressure ="" ;
/*
* checking with if-else condition
* if pressure is more than 68
* and assigning value accordingly to
* bloodPressure
*/
if (pressure > 68)
bloodPressure = "not low" ;
else
bloodPressure = "low" ;
//Display the result as mentioned with message
System.out.println("Your blood pressure is :" + bloodPressure) ;
}
/*
* The following is commented.
* In case you want to run the code
* please uncomment it. Here java is used
* to provided the asked program structure
* as no specific language was mentioned.
/*
public static void main (String [] args) {
calculateBloodPressure(65);
calculateBloodPressure(78);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.