Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hurry up please I only have 15 minutes 2 Part (1) Define a class with the following specifications: The class name is Heightweightatio with three

image text in transcribed
Hurry up please I only have 15 minutes image text in transcribed
2 Part (1) Define a class with the following specifications: The class name is Heightweightatio with three private data members gender istringas male or female in any letter case, height double in om, and weight (double in al. Write a constructor that accepts gender, height and weight as input parameters to in the private data members 6. Previdence () method and is mutato (se method for the height data member & Define a public method called check Ratiof which checks the height weight rate and returns the decisions Holan. The height weight ratio decision is checked as the following Male Acceptable when we wee height 105) and height otherwise, is not acceptable Female: Acceptable when weight is between (height100) und heighe-xotherwise, is not acceptable Define a poble method called showDetail to show all details in the following sample Gender: Male Height: 170cm We24 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 person from the dass Helghtwelght Ratio and initialize its private members according to the input data. Display the details of person object. d Display the message: "Highe'weight ratio decision acceptable" OR "Hightweight rate decision not acceptable" based on the check Ratio) decision D Sample Input/Output Enter Gender, Height and Weight: Male 170 74 Gender: Male Height: 170 cm Weight: 74 kg Hightweight ratio decisions acceptable Note: Your answer should follow the givee sample input/output. Part (1) Define a class with the following specifications The class name is Heightweightkatlo with three private data members:gender (Sering as male or female in any better case), height double in cm), and weight (double in kg) . Write a constructor that accepts gender, height and weight as input parameters to initializes the private data members. Provide an secessor (get) method and a mutter (sed) method for the bright data member d. Define a public method called check Ratiol) which checks the height weight ratio and returns the decisions Boolean The beight weight ratio decision is checked as the following Make: Acceptable when weight is between (height-105) and (height-95), otherwise, is not acceptable Female: Acceptable when weight is between (height-100) and (height:90); otherwise, is not acceptable Define a public method called show Details to show all details as in the following sample: Gender: Male Height: 170 cm Weight: 74 kt. 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 person 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: "Hight'weight ratio decision: acceptable" OR "Hightweight ratio decision not oceptable" based on the check Ratio) decision Sample Input/Output Enter Gender, Height and Weight: Male 1704 Gender: Male Height: 170 cm Weight: 74 kg Mightweight ratio decision stable Note: Your answer should follow the given sample input/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

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions