Create a Java class file called PulsePressureIST140. This program will compute a user's pulse pressure based on two inputs: the systolic pressure (a int value) and the diastolic pressure (an int value). Once the input is complete, your program should echo-print the input values with descriptive messages, like so: You entered a pressure of 120 / 80. Next, add code to your program to compute the pulse pressure. You will need to declare another variable (an int) to store the pulse pressure value. Once you have used the input values to compute the pulse pressure, output the pulse pressure to the screen with a descriptive message: You entered a pressure of 120 / 80. Your pulse pressure is: 40. Next, you will add code to your program to detect a "high" pulse pressure. If the pulse pressure is greater than 80 mmHg, inform the user that their pulse pressure is high. Use a simple if statement (no else clause). For example: You entered a pressure of 170 / 80. Your pulse pressure is: 90. Your pulse pressure is high.
While each of us has had a reading of our blood pressure taken, many of us may not know what blood pressure actually means. Blood pressure is expressed as a ratio of the maximum (systolic) and minimum (diastolic) pressure found in the aorta during one cardiac cycle. These pressure values are measured in millimeters of mercury (mmHg).
Determining abnormal blood pressure is critical for diagnosing and averting a number of serious health problems (e.g. heart disease and stroke). Doctors therefore make decisions about the potential for serious health problems based on a few simple calculations. One simple calculation of interest is pulse pressure (PP). The pulse pressure of an individual can be computed as the difference between the systolic and diastolic pressures.
Create a Java class file called PulsePressureIST140. This program will compute a user's pulse pressure based on two inputs: the systolic pressure (a int value) and the diastolic pressure (an int value). Once the input is complete, your program should echo-print the input values with descriptive messages, like so:
You entered a pressure of 120 / 80.
Next, add code to your program to compute the pulse pressure. You will need to declare another variable (an int) to store the pulse pressure value. Once you have used the input values to compute the pulse pressure, output the pulse pressure to the screen with a descriptive message:
You entered a pressure of 120 / 80. Your pulse pressure is: 40.
Next, you will add code to your program to detect a "high" pulse pressure. If the pulse pressure is greater than 80 mmHg, inform the user that their pulse pressure is high. Use a simple if statement (no else clause). For example:
You entered a pressure of 170 / 80. Your pulse pressure is: 90. Your pulse pressure is high.
Don't forget to follow the Java Coding Guidelines (shown below):
Comments
- Each program must follow the Javadoc guidelines for documentation, including file-level and method-level comments.
- Each line that ends in a semicolon must have a comment in descriptive English.
- Additional descriptive comments are encouraged.
Program Contents
- All primitive variables initialized.
- No “goto”, label, or "continue" statements are used.
- No use of "break" outside of a switch statement.
- Arrays are declared with the [ ] preceding the array name.
Program Style
- All code indented three spaces within blocks (curly braces). Do NOT use tabs.
- All code must exhibit proper alignment of curly braces { } as modeled in class.
- All code must fit within 80 columns or less.
Variable Names
- Variables named according to convention:
- Each variable name contains only letters or digits.
- The first character in a variable name is a lowercase letter.
- Constants named according to convention:
- Each constant contains only upper-case letters.
Use this template:
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images