Question: need ans asaaaap!!! Part (1) Define a dass with the following specifications: The class name is HeightweightRatio with three private data members: gender (String as
Part (1) Define a dass with the following specifications: The class name is HeightweightRatio with three private data members: gender (String as male or female in any letter case), height (double in cm), and weight double in b. Write a constructor that accepts pender, height and weight as input parameters to initiatives the private data members. Provide an accessor (get) method and a multor (set) method for the height data member Define a public method called check Ratio) which cocks the height weight rution and retums the decision as Boolean The height weight ratio decision is checked as the following Male: Acceptable when weight is between (height105) and (height 95}, otherwise, is not acceptable Female. Acceptable when weight is between (height-00) und height %), otherwise, is not acceptable .. Define a public method called showDetails to show all details as in the following ample Gender is Male Height is 170 CM Weight is 74 KG Part (2) Write a Java application to do the following a. Asks the user to input his/her gender, height and weight b. Create an object called persona from the class Heightweight Ratio and initialize its private members according to the input data. Display the details of person object. d Display the message: "Acceptable Hight Weight Ratio" OR "Not Acceptable HighWeight Ratio" based on the check Ratiol) decision Sample Input/Output Input Genker. Height and Weight Male i 70 74 Gender Male Height is 170 CM Weight is 14 KG Acceptable Hight/Weight Ratio Note: Your answer should follow the givee sample input/output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
