Problem

Define two classes, Patient and Billing, whose objects are records for a clinic. Derive...

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);   }}

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT