Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 . 3 ( 3 0 points ) - OOP, Using and Creating ADTs In the HeartTransplant assignment the HeartTransplant class stores patients on
Problem points 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 Patient i patients;
NOT ALL methods and instance variables are shown because of space constraint
Default constructor: initializes all instance variables to null 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
Forh 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
Implementation not shown
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started