Question: Java eclipse / zybook : note: Needs super class / subclass inheritance Define a class Person that holds person's name and appropriate constructors, get/set methods,

Java eclipse / zybook :

note: Needs super class / subclass inheritance

Define a class Person that holds person's name and appropriate constructors, get/set methods, display and hasSameName methods. hasSameName method will return true if two objects of data type Person have the same name. Then define a class named Doctor whose objects are records for a clinic's doctors. Drive this class from the class Person. A Doctor record has doctor's name, a specialty, and office visit fee. Give your class a reasonable complement of constructors and get/set methods, and an equals method as well. The equals method returns true if two doctor records are the same. Name this class BillingRecordDemo. Drive Patient form the class Person. A patient record has the Patient's name, and an identification number. A Billing object will contain a Patient object and a Doctor object. Give your class a reasonable complement of constructors, get/set methods, display and an equals method.

Use the following BillingRecordDemo.java:

import java.util.Scanner;

public class BillingRecordDemo {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

Patient p1 = new Patient("John Brook", 110453);

Patient p2 = new Patient("Samantha Oliver", 921123);

Patient p3 = new Patient("Ryan Badr", 118922);

Patient p4 = new Patient("Mona Sharma", 211156);

Doctor d1 = new Doctor("Garry Allen", "Internal Medicine", 245.90);

Doctor d2 = new Doctor("Sarah Elder", "Surgery", 425.75);

Billing b1 = new Billing(d1 , p1);

Billing b2 = new Billing(d1 , p2);

d1.display();

Billing b3 = new Billing(d2 , p3);

Billing b4 = new Billing(d2 , p4);

Billing b5 = new Billing(d2 , p1);

d2.display();

}

}

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!