Java Reference
In-Depth Information
public Person()
{...}
public Person(String theName)
{...}
public Person(Person theObject)
{...}
public String getName()
{...}
public void setName(String theName)
{...}
public String toString()
{...}
public boolean equals(Object other)
{...}
}
7.
Give the definition of two classes, Patient and Billing , whose objects are
records for a clinic. Patient will be derived from the class Person given in Pro-
gramming Project 6. A Patient record has the patient's name (inherited from
the class Person ) and primary physician, of type Doctor defined in Programming
Project 5. A Billing object will contain a Patient object and a Doctor object,
and an amount due of type double . Be sure your classes have a reasonable com-
plement of constructors, accessor and mutator methods, and suitably defined
equals and toString methods. First write a driver program to test all your meth-
ods, then write a test program that creates at least two patients, at least two doc-
tors, and at least two Billing records, and then prints out the total income from
the Billing records.
Search WWH ::




Custom Search