Question 1: BMI (Body Mass Index) Calculator (use if if-else) You are developing a program that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Question 1: BMI (Body Mass Index) Calculator (use "if" "if-else") You are developing a program that calculates a person's BMI based on their weight (in kilograms) and height (in meters). Write a Java program that takes the weight and height as input and calculates the BMI using the formula: BMI = weight/ (height^2). The program should then categorize the BMI as follows: Underweight: BMI less than 18.5 Normal weight: BMI between 18.5 and 24.9 Overweight: BMI between 25 and 29.9 Obesity: BMI 30 or greater Display the BMI in the format of %.2f. Please check the usage of System.out.format. After showing the user the category, you ask the user a question "do you some tips according to your BMI?". If the user input yes/y/Y, you print the follow information accordingly: • Underweight: "Please eat well and do more excises." • Normal weight: "Congratulations, you are doing fairly well. Keep on going." Overweight: "Please watch out what you eat and do more excises!" Obesity: "Please contact our experts for professional help." • If the user input anything else, you print the message "Nice to meet you too. Bye!" The output is shown as following (Here show imcomplete combinations of BMI and yes/Y/y and some cases of non yes/Y/y inputs.) Figure 1: BMI = "Underweight", tip="yes" Welcome to BMI Calculator Enter weight (in kilograms): 45 Enter height (in meters): 1.60 BMI: 17.58 Category: Underweight do you some tips according to your BMI? yes Please eat well and do more excises. Welcome to BMI Calculator Enter weight (in kilograms): 68 Enter height (in meters): 1.70 BMI: 20.76 Category: Normal weight do you some tips according to your BMI? Congratulations, you are doing fairly well. Keep on going. Figure 3: BMI = "Overweight", tip "Y" Welcome to BMI Calculator Enter weight (in kilograms): 80 Enter height (in meters): 1.70 BMI: 27.68 Category: Overweight do you some tips according to your BMI? Please watch out what you eat and do more excises! Figure 4: BMI "Obesity", tip "yes" Welcome to BMI Calculator Enter weight (in kilograms): 200 Enter height (in meters): 1.80 BMI: 61.73 Category: Obesity do you some tips according to your BMI?- yes Please contact our experts for professional help. Figure 5: BMI-"Obesity", tip "Yes" (notice case sensitive) Welcome to BMI Calculator Enter weight (in kilograms): 200.05 Enter height (in meters): 1.00 BMI: 61.74 Category: Obesity do you some tips according to your BMI? Yes Nice to meet you too. Bye! Question 1: BMI (Body Mass Index) Calculator (use "if" "if-else") You are developing a program that calculates a person's BMI based on their weight (in kilograms) and height (in meters). Write a Java program that takes the weight and height as input and calculates the BMI using the formula: BMI = weight/ (height^2). The program should then categorize the BMI as follows: Underweight: BMI less than 18.5 Normal weight: BMI between 18.5 and 24.9 Overweight: BMI between 25 and 29.9 Obesity: BMI 30 or greater Display the BMI in the format of %.2f. Please check the usage of System.out.format. After showing the user the category, you ask the user a question "do you some tips according to your BMI?". If the user input yes/y/Y, you print the follow information accordingly: • Underweight: "Please eat well and do more excises." • Normal weight: "Congratulations, you are doing fairly well. Keep on going." Overweight: "Please watch out what you eat and do more excises!" Obesity: "Please contact our experts for professional help." • If the user input anything else, you print the message "Nice to meet you too. Bye!" The output is shown as following (Here show imcomplete combinations of BMI and yes/Y/y and some cases of non yes/Y/y inputs.) Figure 1: BMI = "Underweight", tip="yes" Welcome to BMI Calculator Enter weight (in kilograms): 45 Enter height (in meters): 1.60 BMI: 17.58 Category: Underweight do you some tips according to your BMI? yes Please eat well and do more excises. Welcome to BMI Calculator Enter weight (in kilograms): 68 Enter height (in meters): 1.70 BMI: 20.76 Category: Normal weight do you some tips according to your BMI? Congratulations, you are doing fairly well. Keep on going. Figure 3: BMI = "Overweight", tip "Y" Welcome to BMI Calculator Enter weight (in kilograms): 80 Enter height (in meters): 1.70 BMI: 27.68 Category: Overweight do you some tips according to your BMI? Please watch out what you eat and do more excises! Figure 4: BMI "Obesity", tip "yes" Welcome to BMI Calculator Enter weight (in kilograms): 200 Enter height (in meters): 1.80 BMI: 61.73 Category: Obesity do you some tips according to your BMI?- yes Please contact our experts for professional help. Figure 5: BMI-"Obesity", tip "Yes" (notice case sensitive) Welcome to BMI Calculator Enter weight (in kilograms): 200.05 Enter height (in meters): 1.00 BMI: 61.74 Category: Obesity do you some tips according to your BMI? Yes Nice to meet you too. Bye!
Expert Answer:
Answer rating: 100% (QA)
Here is the Java program that implements the BMI calculator according to the provided requirements j... View the full answer
Related Book For
Fundamentals of quality control and improvement
ISBN: 978-0470226537
3rd edition
Authors: amitava mitra
Posted Date:
Students also viewed these programming questions
-
The units of an item available for sale during the year were as follows: 11 units @ $34 Jan. 1 Inventory Feb. 17 Purchase 12 units @ $36 July 21 Purchase Nov. 23 Purchase 4 units @ $38 17 units @ $39...
-
Can a business-to-business marketer be innovative in the way a brand is built? What are requirements for ingredient brandings, and what are current examples? What industries are more inclined to use...
-
Working on Your Delts. The deltoid muscle is the main muscle that allows you to raise your arm or hold it out. It is connected to the humerus of the upper arm. The person shown below is holding his...
-
Find the point in the first quadrant on the curve y = x + x 1 closest to the origin.
-
Table P29.70 shows measurements of a Hall voltage and corresponding magnetic field for a probe used to measure magnetic fields. (a) Plot these data, and deduce a relationship between the two...
-
Pollution control equipment must be purchased to remove the suspended organic material from liquid. being discharged from a vegetable packing plant. Two alternative pieces of equipment are available...
-
The manager of Quality Fabricators Ltd has just reviewed the income statement for the previous quarter and is concerned by the profit earned. Her main concern is the significant difference between...
-
On June 30, Maloney Party Planners had a $43,000 balance in Accounts Receivable and a$2,493 credit balance in Allowance for Uncollectible Accounts. During July, Maloney made credit sales of $200,000....
-
Write an equation for a rational function with: Vertical asymptotes at x = 1 and x = -3 x-intercepts at x= -6 and x = 6 y-intercept at 7
-
Required: Nancy, who is 59 years old, is the beneficiary of a $220,000 life insurance policy. What amount of the insurance proceeds is taxable under each of the following scenarios? (Do not round any...
-
Suppose you have $48,000 to invest. You're considering Miller-Moore Equine Enterprises (MMEE), which is currently selling for $80 per share. You also notice that a call option with a $80 strike price...
-
Joey is a 21-year-old Japanese-American college student enrolled at Florida State University (FSU), majoring in criminology and sociology. At his university, he is a board member in his fraternity,...
-
24. A cylindrical piece of cork 1.5 feet high with 3 feet diameter is lowered into fresh water. The cork will sink until the buoyant force acting up on its bottom is equal to the weight of the cork...
-
How do institutions such as education, politics, and the economy contribute to the construction and maintenance of social hierarchies, and how might they be reformed to promote greater equity and...
-
How do social movements and collective action challenge existing social structures and power dynamics, and what strategies have been effective in promoting social change and reform?
-
exploration of the history of street art and its controversies of ppt/quicktime video.
-
A certain state requires that for children who are 4 years old, the number of children per caregiver in a childcare center not exceed 15 . If there are 120 children who are 4 years old at a childcare...
-
Consider the function f and its graph. a. Estimate the zeros of the area function b. Estimate the points (if any) at which A has a local maximum or minimum. c. Sketch a graph of A, for 0 x 10,...
-
Reinforced concrete beams are used in bridges. However, cracks develop in these beams and it has an accumulation effect over time. The time to failure of such bridges, in days, is modeled by a...
-
Explain the principles of replication, randomization, and blocking, and discuss their roles in experimental design in a semiconductor manufacturing company.
-
In a time-terminated life testing plan, it is desired to reject lots with a mean life of 1500 hours with a probability of 0.95 and also to reject lots with a mean life of 7500 hours with a...
-
Using the data in exercise 2, determine how many units of resources the firm will want to acquire. Data from in exercise 2 Using the information in the following table, calculate the marginal revenue...
-
What does it mean to say that the demand for resources is a derived demand? Is the demand for all goods and services a derived demand?
-
Using the information in the following table, calculate the marginal revenue product (MRP = MPP MR). Unit of Resources Total Resource Output Price Price 1 10 $5 $10 2 25 $5 $10 345 35 $5 $10 40 $5...
Study smarter with the SolutionInn App