Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

******Use Java**** Person Class: Create a class called Person with definition as follows. Completing the definitions of the methods is part of this programming assignment.

image text in transcribedimage text in transcribedimage text in transcribed******Use Java****

Person Class: Create a class called Person with definition as follows. Completing the definitions of the methods is part of this programming assignment. public class Person private String name; public Person() {} public Person (String name) {} public Person (Person object) {} public String getName() {} public String setName (String name) {} public String tostring () {} public boolean equals(Person other) {} Employee Class: The Employee class extends the Person class and has instance variable hi reDate (since it will hold the hiring date of an employee so use Date class). This class will have following three constructors: 1. No argument constructor 2. An argument constructor that receives name and hi reDate. 3. An argument constructor that receives Employee object. Define the constructors, mutator and accessor methods, and suitably define tostring and equals methods. SalariedEmployee Class: The SalariedEmployee class extends the Employee class and has instance variable sa lary. The class will have the following three constructors: 1. No argument constructor 2. An argument constructor that receives name, hireDate and Salary. 3. An argument constructor that receives SalariedEmployee object. Define the constructors, mutator and accessor methods, and suitably define tostring and eqquals methods. Doctor Class: Give the definition of a class named Doctor whose objects are records for a clinic's doctors. This class will be a derived class of the class SalariedEmployee. A Doctor record has the doctor's specialty (such as "Pediatrician", "Obstetrician", "General Practitioner", and so forth; so, use the type String) and office visit fee (use type double). Be sure your class has a reasonable complement of constructors, accessor, and mutator methods, and suitably defined equals and tos tring methods. Patient Class: Give the definition of class Patient whose objects are records for a clinic. Patient will be derived from the class Person. A Patient record has the patient's name (inherited from the class Person) and primary physician of type Doctor. Be sure your class has a reasonable complement of constructors, accessor and mutator methods, and suitably defined equals and toString methods. Billing Class: Give the definition of class Billing whose objects are records for a clinic. A Billing object will contain a Patient object, a Doctor object, and an amount due of type double. Be sure your class has a reasonable complement of constructors, accessor and mutator methods, and suitably defined equals and tostring methods. Main Class Write a test program that creates at least three patients, at least three doctors, and at least three Billing records, and then prints out the patients, doctors and billing information. At the end print out the total income from the Billing records. Sample Output The sample output of the main program is depicted in the below picture. \begin{tabular}{l} The doctor Bob was hired on Wed Dec 3119:00:12 EST 1969 at Salary 34060.0. \\ The speciality is Pediatrist and visit fee is $16.5. \\ The doctor Susan was hired on Wed Dec 3119:04:14 EST 1969 at Salary 456000.0. \\ The speciality is Surgeon and visit fee is $150.5. \\ The doctor Lilly was hired on Wed Dec 3119:04:14 EST 1969 at Salary 290000.0. \\ The speciality is Kidney and visit fee is $95.5. \\ *Patient's Information* \\ The name is: Fred, Primary doctor is: Bob \\ The name is: Sally, Primary doctor is: Susan \\ The name is: John, Primary doctor is: Lilly \\ *Billings's Information* \\ Patient: Fred \\ Doctor: Bob \\ Amount Due: $21.0 \\ Patient: Sally \\ poctor: Susan \\ Amount Due: $150.5 \\ Patient: John \\ Doctor: Lilly \\ Amount Due: $170.0 \\ The total income from billing records is: 341.5 \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems X Special Issue On Database And Expert Systems Applications Lncs 8220

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2013th Edition

3642412203, 978-3642412202

Students also viewed these Databases questions

Question

Values: What is important to me?

Answered: 1 week ago