Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write java code : assume that you have access to a class called Patient. This cl

ID: 3632028 • Letter: W

Question

write java code :
assume that you have access to a class called Patient. This
class is used to describe hospital patient information in a hospital database application. You
should assume that the Patient class has all the constructors, accessors and mutators as
emphasised in the lecture examples and the worksheet exercises.
Design a class called PatientStats. Objects of this class are used to describe the weight and
height of a hospital patient and are responsible for the following information:
• Patient: A Patient class object used to describe the patient.
• Height: An integer in the range 100 to 250 used to describe the height of the patient in cm.
• Weight: An integer in the range 5 to 150 used to describe the weight of the patient in kg.
Two PatientStats objects are considered equal if and only if they have the same patient, weight
and height.
Your design must include all of the good features that have been re-enforced in the worksheets
7, 8 and 9..
Hint: you may use one mutator for updating all of the state information if you wish. Also you
may omit the alternate #1 constructor and the toString accessor.

Explanation / Answer

/* I don't know about which lecture are you talking about, but I guess this might be the right answer. Kindly let me know of the lecture too. Thnx -Creator */ class Patient{ private int height; private int weight; public Patient(int i, int j){ this.setHeight(i); this.setWeight(j); } public void setHeight(int i){ if(i>100&&i5 && j