Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Having trouble with this code, can use some guidance, not asking for the whole code just like an example. I guess my biggest struggle is

Having trouble with this code, can use some guidance, not asking for the whole code just like an example. I guess my biggest struggle is trying to connect every method together and how to do so. Using java as language ,The prompt is:

Create a BMI calculator that reads the users weight and height (providing an option for the user to select which formula to use), and then calculates and displays the users body mass index. Also, display the BMI categories and their values from the National Heart Lung and Blood Institute

  • BMICalculator is a public class declared in BMICalculator.java
  • BMICalculator contains a public instance method called readUserData that makes use of both readUnitType and readMeasurementData methods
  • BMICalculator contains a private instance method called readUnitType
  • BMICalculator contains a private instance method called readMeasurementData that calls either readMetricData or readImperialData, depending on the unit type
  • BMICalculator contains a private instance method called readMetricData
  • BMICalculator contains a private method called readImperialData
  • BMICalculator contains a public instance method called calculateBmi that calculates the user's BMI and BMI category
  • BMICalculator contains a private instance method called calculateBmiCategory that determines the user's BMI category
  • BMICalculator contains a public instance method called displayBmi that prints the BMI value and category to standard output
  • BMICalculator contains a public instance method called getWeight
  • BMICalculator contains a private instance method called setWeight
  • BMICalculator contains a public instance method called getHeight
  • BMICalculator contains a private instance method called setHeight
  • BMICalculator contains a public instance method called getBmi
  • BMICalculator contains a public instance method called getBmiCategory

the main method only uses

 test.readUserData(); test.calculateBmi(); test.displayBmi();

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions