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.

Computer Science & Information Technology

You might also like to view...

What is the worst case for the naive string search algorithm?

a. All characters of the pattern P are present in text T b. All characters of the pattern P and text T are the same c. Pattern P is of size one d. Text T is composed of pattern P concatenated N times

Computer Science & Information Technology

Which of the following characteristics of a computer depends on the number of Fetch/Execute cycles it performs per second?

a. memory size b. price c. speed d. ALU

Computer Science & Information Technology

Which of the following is not a step in queue deletion?

A. Search queue for data to be deleted.  B. Pass data from deleted node back to calling function. C. Set front pointer to next item in queue. D. Subtract one from queue counter if implemented. E. If queue empty, set rear pointer to null.

Computer Science & Information Technology

______ is a magnetically coated ribbon of plastic that is capable of storing large amounts of data and information at a low cost.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology