Question: Question 4 : Define a class named Patient that contains: ? ( ) a . A String variable named name. b . A double variable

Question 4:
Define a class named Patient that contains: ?()
a. A String variable named name.
b. A double variable named weight.
c. A double variable named height.
d. A default constructor to initialize the three variables.
e. A parameterized constructor to initialize the three instance variables.
f. One accessor method for each one of the three instance variables.
g. One mutator method for each one of the three instance variables.
h. A method named BMI with no parameters to return the body mass index of the patient using the following formula: , MMI = weight ?? height ?2
i. A patientStatus method to display the patient status as follows and has one argument (double bmi):
\table[[BMI,Weight Status],[BMI 18.5,Underweight],[18.5 BMI 24.9,Normal],[25 BMI 29.9,Overweight],[BMI >30,Obese]]
Write a main class named PatientTest that:
a. Instantiate class Patient with object name p1.
b. Call the appropriate mutator methods to set the values of name, weight, and height of p1 to Adam, 75, and 190 respectively.
c. Display the body mass index for the Patient p1.
d. Display the patient status of Patient p1.
e. Create another object of Patient named p2 with Huda, 60, and 150 for name, weight, and height respectively. (Use parameterized constructor).
f. Call the BMI and patient status methods for the Patient p2.
Question 4 : Define a class named Patient that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!