Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < names.length; ++i) {
- if (name.equalsIgnoreCase(names[i])) {
- double bmi = weight[i] / (height[i] * height[i]);
- String bodyType = (bmi < 18.5 ? "underweight" : (bmi < 25 ? "normal" : (bmi < 30 ? "overweight" : "obese")));
- System.out.println(name + " is " + bodyType + ", BMI index = " + bmi);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement