Question
Create the definition of two classes, Patient and Billing, whose objects are records for a clinic. Patient will be derived from the class Person given
Create the definition of two classes, Patient and Billing, whose objects are records for a clinic. Patient will be derived from the class Person given below. The skeleton of the definition of the class Person is listed below. Completing the definitions of the methods is part of this programming project. public class Person { private String name; public Person() {...} public Person(String theName) {...} public Person(Person theObject) {...} public String getName() {...} public void setName(String theName) {...} public String toString() {...} public boolean equals(Object other) {...} } A Patient record has the patients name (inherited from the class Person) and primary physician of type Doctor defined as follows.
A Billing object will contain a Patient object, a Doctor object, and an amount due of type double. Be sure your classes have a reasonable complement of constructors, accessor and mutator methods, and suitably defined equals and toString methods. Create the classes as described before. Then 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 prints out the total income from the Billing records.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started