Define two classes, Patient and Billing, whose objects are records for a clinic. Derive Patient from the class Person given in Listing.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 (Define a class named Doctor whose objects are records for a clinic’s doctors. Derive this class from the class Person given a Doctor record has the doctor’s name—defined in the class Person—a specialty as a string (for example Pediatrician, Obstetrician, General Practitioner, and so on), and an office-visit fee (use the type double). Give your class a reasonable complement of constructors and accessor methods, and an equals method as well. Write a driver program to test all your methods.). 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.
public class Person{ private String name; public Person() { name = "No name yet"; } 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); }}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.