Question: OOP, Using and Creating ADTs In the HeartTransplant assignment the HeartTransplant class stores patients on an array of Patient objects called patients. Patients are inserted
OOP, Using and Creating ADTs
In the HeartTransplant assignment the HeartTransplant class stores patients on an array of Patient objects called patients. Patients are inserted into the array from the input file using the readPatients method. Refer to the classes below. Not all instance variables and methods are shown because of space constraints.
public class HeartTransplant
I patient array, each Patient is read from the data file
private, Patienti patients;
NOT ALL methods and instance variables are shown because of space constraint
Default constructor: initializes all instance variables to nutl Returns patients array
Initialize the instance variable patients array with numberoflines length.
Reads from the command line data file.
File Format:
ID Ethnicity, Gender, Age, Cause, Urgency, State of health
Each line corresponds to one Patient, all values are integers.
For each line
Creates a Patient object and inserts it into the array
public void readpatients int numberoflines
II Implementation not shown
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
