NOTE 2: (1) Neither use nor import any other library/package aside from: java.util.Scanner; (ii) Neither implement...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
NOTE 2: (1) Neither use nor import any other library/package aside from: java.util.Scanner; (ii) Neither implement nor use any custom/user-defined function(s) for any task herein. (iii) with reference to each task herein, do NOT implement or use any of the following constructs: iterations/loops (for {}, while {}, etc.). 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." I 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. Figure 2: BMI = "Normal", tip = "y" Welcome to BMI Calculator ook ******** Enter weight (in kilograms): 60 Enter height (in meters): 1.70 BMI: 20.76 ******** Welcome to BMI Calculator -******* Category: Normal weight do you some tips according to your BMI? y Congratulations, you are doing fairly well. Keep on going. Figure 3: BMI= "Overweight", tip= "Y" ******* Enter weight (in kilograms): 80 Enter height (in meters): 1.70 BMI: 27.68 ook Figure 4: BMI = "Obesity", tip = "yes" 000 *********** Welcome to BMI Calculator *|*|*|—————******- **** Category: Overweight do you some tips according to your BMI? Y Please watch out what you eat and do more excises! 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.80 BMI: 61.74 Category: Obesity do you some tips according to your BMI? Yes Nice to meet you too. Bye! NOTE 2: (1) Neither use nor import any other library/package aside from: java.util.Scanner; (ii) Neither implement nor use any custom/user-defined function(s) for any task herein. (iii) with reference to each task herein, do NOT implement or use any of the following constructs: iterations/loops (for {}, while {}, etc.). 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." I 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. Figure 2: BMI = "Normal", tip = "y" Welcome to BMI Calculator ook ******** Enter weight (in kilograms): 60 Enter height (in meters): 1.70 BMI: 20.76 ******** Welcome to BMI Calculator -******* Category: Normal weight do you some tips according to your BMI? y Congratulations, you are doing fairly well. Keep on going. Figure 3: BMI= "Overweight", tip= "Y" ******* Enter weight (in kilograms): 80 Enter height (in meters): 1.70 BMI: 27.68 ook Figure 4: BMI = "Obesity", tip = "yes" 000 *********** Welcome to BMI Calculator *|*|*|—————******- **** Category: Overweight do you some tips according to your BMI? Y Please watch out what you eat and do more excises! 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.80 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)
Question 1 import javautilScanner public class BMICalculator public stati... View the full answer
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
Sometimes, lenders allow or require a downpayment before they extend you the loan. What would be the advantage to the lender? What would be the advantage to the borrower?!
-
From a friend who is Human Resources Manager for a law fi rm: I need your help. Our partners are contemplating the introduction of 360-degree appraisal, and have asked my advice about the benefi ts...
-
Question 2: Grade Calculator (Use "switch" and "if") Write a program that takes a student's score (out of 100) as input and prints out their corresponding grade according to the following scale (use...
-
Find the minimum and maximum values of (x, y) = x 2 y on the ellipse 4x 2 + 9y 2 = 36.
-
A proton moving in the plane of the page has a kinetic energy of 6.00 MeV. A magnetic field of magnitude B = 1.00 T is directed into the page. The proton enters the magnetic field with its velocity...
-
A small research device is purchased for $10,000 and depreciated by MACRS depreciation. The net benefits from the device, before deducting depreciation, are $2000 at the end of the first year and...
-
Fine Candles Ltd has prepared the following draft profit analysis for the current year. Required Answer each of the following four independent situations. (a) If the companys manager is considering...
-
McDonald's Corporation franchises and operates more than 36,000 fast-service restaurants around the world. Buffalo Wild Wings franchises and operates more than 1,000 restaurants in North America....
-
On the 1st of January, David by three separate letters which he posted to Ann, Bev and Cathy informed them that he was selling his 2004 BMW car for $1M. He stated in the letter that the offer would...
-
Perfect Parties, Inc. has several divisions, one of which provides birthday parties at their facility, and has provided the actual and planning budget results for the month of June. The Controller...
-
Design a rater training program that will help supervisors assess the performance of their subordinates as accurately as possible. What techniques will you include? What important variables can...
-
How do cultural norms and values intersect with social structure, influencing patterns of behavior, identity formation, and societal organization ?
-
How do historical legacies of colonialism, imperialism, and systemic injustice continue to shape contemporary power structures, and what steps can be taken to address and redress these historical...
-
Izabella is 20 years old. Eighteen months ago, she started selling some of her old clothing which no longer suited her on peer-to-peer social shopping apps such as Letgo and Depop. She was surprised...
-
(b) Suppose an individual borrows an amount of K28, 300 for 10 months at an interest rate of 9.25%. Calculate (i) The interest due on the loan. (ii) The maturity value at the end of 10 months.. (c)...
-
State the domain, then divide. 4x5 7x7 5 8
-
A chef plans to mix 100% vinegar with Italian dressing. The Italian dressing contains 12% vinegar. The chef wants to make 320 milliliters of a mixture that contains 23%vinegar. How much vinegar and...
-
Use a calculator to evaluate the expression. Round your result to the nearest thousandth. V (32 + #)
-
Barnes accepted Clarks offer to sell to him a portion of Clarks coin collection. Clark forgot that his prized $20 gold piece at the time of the offer and acceptance was included in the portion which...
-
Seindenberg and Hutchinson (the site owners) leased a fouracre tract of land (the Bluff Road site) to a chemical manufacturing corporation (COCC). While the lease initially was for the sole purpose...
-
This is an appeal from a take-nothing summary judgment granted the defendants in a social host liability case. Appellants seventeen-year-old daughter was killed in a single-car accident after leaving...
-
Suppose the output price falls from \($5\) to \($4\) to \($3\) to \($1\) in exercise 2. How would that change your answers to exercises 2 and 3? Data from in exercise 2 Using the information in the...
-
Using the data in exercise 2, calculate the marginal factor cost. Data from in exercise 2 Using the information in the following table, calculate the marginal revenue product (MRP = MPP MR). Unit of...
-
Suppose the resource price rises from \($10\) to \($12\) to \($14\) to \($18\) to \($20\) as resource units go from 1 to 5. How would that change your answer to exercise 5? How would it change your...
Study smarter with the SolutionInn App