Question: Project 2 Java Program - Need Help on this Assignment - Instructions Below Java II Project 2 Purpose: Using instantiable classes, Object Lists, Serialization of
Project 2 Java Program - Need Help on this Assignment - Instructions Below


Java II Project 2 Purpose: Using instantiable classes, Object Lists, Serialization of objects to a file Topic: To Your Health company would like the ability to calculate a customer's Body Mass Index (BMI). Since their customers are from various backgrounds, they need the ability to enter their height and weight in metric or standard measurements. For metric, height will be entered in centimeters and weight in kilograms. For standard, height will be entered in inches and weight in pounds. O . This project will contain three classes, one for creating BMI objects, one to test the features of the class, and one to provide the console application (interface) First create a classed called BMI, (NO main method) Code instance variables (does not have a static modifier) of integer type named weight, height, and option; String variables for patient first and last names Code a default constructor that sets weight to 70 kg, height to 170 cm and option to 1 (metric), and your choice of first and last names Code a parameterized constructor that accepts the option, weight, height, first name, last name Code getters and setters for each field In setters for weight and height, validate for > 0, if not, set to default values based on the option In setters for first and last name, validate for not empty, set to default values Code a method named calcBMI that calculates and returns the BMI based on the option (metric or standard research the web for formulas) Code a toString override method that returns the data from the object in the following format: "BMI is 99.99 and is consider XXXXXXXXXXXX. Be sure to use the calcBMI method to get the BMI value. Sample calculations: Metric: 70 kg and 170 cm should be 24.20 Standard: 170 lbs and 70 inches should be 24.40 Example: BMI is 24.20 and is consider Normal Refer to the web to get the BMI categories O O O Second, create a another class called BMITest (with a main method) Be sure to test all parts of your class (both constructors, getters, setters, methods) Hard code the values necessary to test. No need to prompt user. Third, create a class called BMI Program (with a main method) Once your instantiable class (BMI) has been coded and tested thoroughly (BMITest), you can create a user interface program that will use it. Create and instantiate a static global List that will be used to hold BMI objects Use a menu-driven approach (Option 1 Metric; Option 2 Standard; Option 3 Exit) Prompt for weight and height based on option chosen (be sure to use Try/Catch) Construct a BMI object with the values entered, or default values if not valid Display the results of the entered BMI data (use the toString method from your BMI class) Ask the user if they want to write the BMI data to the file. If yes, add the object to the BMI List, then return to Menu. If not, return to Menu. At Exit, we need to take the objects in the list and serialize them to the file. The file will be over- written with the objects in the current list. Create and open an output file stream Serialize the list to the file 1 Close the file when done Project is worth 40 points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
