Define two classes, Patient and Billing, whose objects are records for a clinic. Derive Patient from the class Person given in Listing 8.1. A Patient record has the patient’s name (defined in the class Person) and identification number (use the type String). A Billing object will contain a Patient object and a Doctor object (from Practice Program 2). Give your classes a reasonable complement of constructors and accessor methods, and an equals method as well. First write a driver program to test all your methods, then write a test program that creates at least two patients, at least two doctors, and at least two Billing records and then displays the total income from the Billing records.
This project sounds reasonable until an attempt is made to put Doctor and Patient objects in the Billing class. A Billing object actually needs just the doctor’s name, patient’s name, and doctor’s office fee. The approach taken in the solution shown here is to require a Doctor and a Patient object in the constructor for a Billing object, then use Doctor and Patient accessor methods to set the parameter values for the Billing object.
ee the code in Patient.java, PatientTest.java, Billing,java, and BillingTest.java.
You might also like to view...
To unhide a field, in the Unhide Columns dialog box, you ________
A) right-click the field's name in the list B) click the field's checkbox C) double-click the field's name in the list D) uncheck the field's checkbox
Google+ circles define one-way relationships
Indicate whether the statement is true or false