Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in JAVA please Create the following classes: Person Class: Create a class called Person with definition as follows. Completing the definitions of the methods

write in JAVA please
image text in transcribed
image text in transcribed
image text in transcribed
Create the following classes: Person Class: Create a class called Person with definition as follows. Completing the definitions of the methods is part of this programming assignment. Employec Class: The Employee class extends the Person class and has instance varible hi reDate (since it will hold the hining 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 naree and hi reDate. 3. An argument constructor that receives Emp loyee object. Define the constructors, mutator and accessor methods, and suitably define tostring and equa is methods. SalariedEmployee Class: The SalariedEmployee class extends the Employee class and has instance variable sa a ary. The chass. 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 Sa lariedFimployee object. Define the constructors, mutator and accessor methods, and suitably define tostring and equals methods. Doctor Class: Give the definition of a class named Doctor whose objects are reconds for a clinic's doctors. This class will be a derived class of the class SalaniedEmployee. A Doctor reeond has the doctor's specalty (such as "Pediatrician", "Obstetriclan", "General Practibionct", 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 defincd equals and tostring 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 Doetor. Be sure your class has a reasonable complement of constructors, aceessor and mutator methods, and suitably defined equals and tostring methods. Billing Class: Give the definition of class Billing whose objects are tecords 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 keast three doctors, and at least three Billing records, and then prints out the patients, doctors and billing information. At the end print our the total income from the Billing reconds Sample Output The sample output of the main prognam is depicted in the below picture. The doctor Bob was hired on Wed Dec 31 19:0e:12 EST 1969 at Salary 34000.0. The speciality is Pediatrist and visit fee is $10.5. The doctor Susan was hired on Wed Dec 31 19:04:14 EST 1969 at Salary 450ee0.0. The speciality is Surgeon and visit fee is $150.5. The doctor Lilly was hired on Wed Dec 31 19:04:14 EST 1969 at Salary 2900e0. 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. Patient: Sally Doctor: Susan Amount Due: $150.5 Patient: John Doctor: Lilly Amount Due: $170.0 The total income from billing records is: 341.5

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

Step: 3

blur-text-image

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

Students also viewed these Databases questions

Question

How does the U.S.C. differ from the U.S.C.A. or U.S.C.S.?

Answered: 1 week ago