Define two classes patient and billing whose objects are


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 programming project is on page 664 of your textbook (#6)

For this Programming Project, start with implementations of the Person, Student, and Undergraduate classes as depicted in Figure 8.4 and the polymorphism demo in Listing 8.6. Define the Employee, Faculty, and Staff classes as depicted in Figure 8.2. The Employee class should have instance variables to store the employee ID as an int and the employee's department as a String. The Faculty class should have an instance variable to store the faculty member's title (e.g. "Professor of Computer Science") as a String. The Staff class should have an instance variable to store the staff member's pay grade (a number from 1 to 20) as an int. Every class should have appropriate constructors, accessors, and mutators, along with a writeOutput method that outputs all of the instance variable values.

Modify the program in Listing 8.6 to include at least one Faculty object and at least one Staff object in addition to the Undergraduate and Student objects. Without modification to the for loop, the report should output the name, employee ID, department, and title for the Faculty objects, and the name, employee ID, department, and pay grade for the Staff objects.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Define two classes patient and billing whose objects are
Reference No:- TGS01644160

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)