For this assignment, you want to create the following classes: Hospital, Patient, Doctor, Drug and Person.?
To make sure that you have the correct relationships between your classes, detain in mind the has a, is a, and uses a relationship.
Use arrays where you see fit.
Write a Driver class that tests your classes by creating a bunch of objects.
--------------------
public class Hospital
Person people[ ] = new Person[10]
class Person extends Hospital
public String name; public int ssn;
class Doctor extends Person
-Patient -ID
class Patient extends Person
Drugs list[ ]
class Drug extends Patient
public String name;
class Driver
public static void main ( String [ ] args ) Hospital A = new Hospital(); A.people[0] = new Patient(B,1) A.people[1] = new Doctor(Fred, 99) Drugs Presc[] = new Drugs[8] Presc[0] = new Drugs(Tylenol) People[0].druglist[] A.people[0].druglist[] = Presc()
|