Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 Create a java class BMICalculator that has a default constructors.Create private data members that are floating - point numbers to represent weight and

Part 1Create a java class BMICalculator that has a default constructors.Create private data members that are floating-point numbers to represent weight and height.Create a private data member that is a collection of strings representing the BMI report strings such as Seriously Underweight for example.Create 2 separate methods on the BMICalculator class to set the height and weight variables used in BMI calculation from user input at the command line that asks for weight in kg and height in meters.Create a method on BMICalculator to calculate the BMI and return that value.Create a class IndividualHealthAssessment whose main method creates a BMICalculator object and gets input from the user and outputs the calculated BMI with a message of what the report is for that value of BMI as a string which it prints on the command line.Part 2Create a JavaFX project which builds a GUI called IndividualHealthAssessment which creates a basic GUI anchor pane container. Make sure to see that the project has a .fxml file and controller class separate from the main app. Double click on the projects .fxml file and it should open Scene Builder for that project.Add a private reference of type BMICalculator which should be instantiated using operator new in the initialize method generated by default in the controller class.Using Scene Builder add 2 textbox controls that will take input for weight in kg and height in meters. In addition, add labels above these text boxes that display labels showing that the textbox control either represents the height or weight parameter.Using Scene Builder add a button and label it Calculate BMI.Using Scene Builder add a label that will be used to display the calculated BMI value (named for example BMICalcLabel)Using Scene Builder add a label that will be used to display the report message for the calculated BMI e.e BMIMessageLabel.Using Scene builder add an event handler method named handleCalcBMI to the CalculateBMI button.Implement the handleCalcBMI button event handler. When clicked, it should fetch the entries that have been made in the weight and height textbox controls (which are strings) and convert them to floating-point numbers. It should then pass those numerical values to the internal BMICalculator object by invoking the set..() methods on the BMICalculator class. The handler function should then fetch the calculated BMI value and display its value in the BMICalcLabel label and display the BMI report message in the BMIMessageLabel label. In netbeans javafx with scene builder .i need a example the output

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions