Question: Create and test a Patient and a Billing class: Define two classes, Patient and Billing , whose objects are records for a clinic. Derive Patient

Create and test a Patient and a Billing class:

Define two classes, Patient and Billing, whose objects are records for a clinic. Derive Patient from the class Person in the Source Code folder.

A Patient record / object has the patients 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 above).

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,

creates at least two doctors, and

creates at least two Billing records, and then

displays the total income from the Billing records (the sum of the Doctor fees from all of the Billing records).

------------------------------------------------------------------------------------------------------

here is the Person.java file:

public class Person { private String name; public Person( ) { name = "No name yet"; // can also say this("No name yet"); // calls the other constructor } public Person(String initialName) { name = initialName; } public void setName(String newName) { name = newName; } public String getName( ) { return name; } public void writeOutput( ) { System.out.println("Name: " + name); } public boolean hasSameName(Person otherPerson) { return this.name.equalsIgnoreCase(otherPerson.name); } } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!