I need help with this lab please help me Tips and Requirements of lab Use parenthesis if needed to ensure your total calculation associativity and order of precedence produces a correct result. Format  your bmi result to 2 decimal places of accuracy.  Use a space around all binary operators (i.e. around arithmetic and assignment operands).  Be sure that your output is well organized. Provide console output comments to organize your result displays.  Define and use named constants in lieu of literal values. Where appropriate, use these named constants in your program solution. Keep source statement width < 80 characters. Be sure to include 3 parts to include in your submission file: program header, the Java* source, the program run (comment out the run).   Remove all tabs - use spaces only. Adhere to the style rules as described in the Coding Style Guidelines.  Make sure the run "matches" your source. If the run you submit could not have come from the source you submit, it will be graded as if you did not hand in a run.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

I need help with this lab please help me

Tips and Requirements of lab

  • Use parenthesis if needed to ensure your total calculation associativity and order of precedence produces a correct result.
  • Format  your bmi result to 2 decimal places of accuracy. 
  • Use a space around all binary operators (i.e. around arithmetic and assignment operands). 
  • Be sure that your output is well organized. Provide console output comments to organize your result displays. 
  • Define and use named constants in lieu of literal values. Where appropriate, use these named constants in your program solution.
  • Keep source statement width < 80 characters.
  • Be sure to include 3 parts to include in your submission file: program header, the Java* source, the program run (comment out the run).  
  • Remove all tabs - use spaces only.
  • Adhere to the style rules as described in the Coding Style Guidelines. 
  • Make sure the run "matches" your source. If the run you submit could not have come from the source you submit, it will be graded as if you did not hand in a run.

 

Testing Specification
Do prompt the user to enter a value for height and weight. Test to ensure that the user provides valid input (e.g. the
value must be a positive number).
Be sure to test and validate that your program generates the expected results (i.e. ensure that your bmi calculation
correctly decides to report the appropriate category.
Show 5 test runs
Demonstrate 4 test runs such that each of the categories is selected. Include a 5th test tha
a conditional to test for valid user input.
Example Run
Your program display should look something like this example run:
/* Test # 1
Enter Height: 1
Enter Weight: -1
invalid input... good bye
/* Test # 2
Enter Height: 105.4
Enter Weight: 16.9
For the height of 105.4cm and weight of 16.9kg, the BMI is: 15.21
Category is: underweight
/* Test # 3
Enter Height: 105.4
Enter Weight: 25
For the height of 105.4cm and weight of 25.0kg, the BMI is: 22.50
Category is: normal weight
/* Test # 4
Enter Height: 105.4
Enter Weight: 30.6
For the height of 105.4cm and weight of 30.6kg, the BMI is: 27.54
Category is: overweight
/* Test # 5
Enter Height: 105.4
Enter Weight: 34.6
For the height of 105.4cm and weight of 34.6kg, the BMI is: 31.15
Category is: obese
hows your program uses
Transcribed Image Text:Testing Specification Do prompt the user to enter a value for height and weight. Test to ensure that the user provides valid input (e.g. the value must be a positive number). Be sure to test and validate that your program generates the expected results (i.e. ensure that your bmi calculation correctly decides to report the appropriate category. Show 5 test runs Demonstrate 4 test runs such that each of the categories is selected. Include a 5th test tha a conditional to test for valid user input. Example Run Your program display should look something like this example run: /* Test # 1 Enter Height: 1 Enter Weight: -1 invalid input... good bye /* Test # 2 Enter Height: 105.4 Enter Weight: 16.9 For the height of 105.4cm and weight of 16.9kg, the BMI is: 15.21 Category is: underweight /* Test # 3 Enter Height: 105.4 Enter Weight: 25 For the height of 105.4cm and weight of 25.0kg, the BMI is: 22.50 Category is: normal weight /* Test # 4 Enter Height: 105.4 Enter Weight: 30.6 For the height of 105.4cm and weight of 30.6kg, the BMI is: 27.54 Category is: overweight /* Test # 5 Enter Height: 105.4 Enter Weight: 34.6 For the height of 105.4cm and weight of 34.6kg, the BMI is: 31.15 Category is: obese hows your program uses
Calculating BMI Using the Metric System
Understand the Application
The body mass index (BMI) is a measure that uses a person's height and weight to indicate if their weight is healthy.
The Program Specification
Write an application that calculates a Body Mass Index (BMI). You will prompt and obtain a height in centimeters and a
weight in kilograms from the user at run-time. Validate user input using a conditional statement. If the input is invalid
print a message to the user and exit your program.
Given the user has entered valid input, your program will calculate and print out the corresponding BMI. Include an
output statement that decides which BMI category that the user falls into.
Calculate the BMI using the following formula: bmi = (weightKg / heightCm / heightCm) * 10000
BMI Categories:
Underweight = < 18.5
Normal weight = 18.5 - 24.9
Overweight = 25-29.9
Obesity = BMI of 30 or greater
Transcribed Image Text:Calculating BMI Using the Metric System Understand the Application The body mass index (BMI) is a measure that uses a person's height and weight to indicate if their weight is healthy. The Program Specification Write an application that calculates a Body Mass Index (BMI). You will prompt and obtain a height in centimeters and a weight in kilograms from the user at run-time. Validate user input using a conditional statement. If the input is invalid print a message to the user and exit your program. Given the user has entered valid input, your program will calculate and print out the corresponding BMI. Include an output statement that decides which BMI category that the user falls into. Calculate the BMI using the following formula: bmi = (weightKg / heightCm / heightCm) * 10000 BMI Categories: Underweight = < 18.5 Normal weight = 18.5 - 24.9 Overweight = 25-29.9 Obesity = BMI of 30 or greater
Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
ASCII Codes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning