Give the definition of a class named Doctor whose objects are records for a clin
ID: 3884950 • Letter: G
Question
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 (covered in class and also in Chapter 7 of the text.) 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 resolvable complement of constructors, accessor and mutator methods, and suitably defined equals and to String methods. Write a program to test all of your methods. Submission Requirements: Submit the aforementioned files in a zip file with the naming strategy: First initial + last name + PS + problem set number.zip As an example, I would submit the code in a zip file named mmeluskyPSl.zip. Submit your zip file via the "Problem Set 1" Canvas dropbox before the date of the close of the assignment.Explanation / Answer
Hi,
1. Doctor.java
public class Doctor extends SalariedEmployee{
private String specialty;
private double visitFees;
public Doctor(String specialty, double visitFees) {
super();// please pass SalariedEmployee class constructor
this.specialty = specialty;
this.visitFees = visitFees;
}
@Override
public boolean equals(Object obj){
return super.equals(obj);
}
@Override
public String toString() {
return super.toString()+" Doctor specialty="+specialty+", visitFees="+visitFees;
}
public String getSpecialty() {
return specialty;
}
public void setSpecialty(String specialty) {
this.specialty = specialty;
}
public double getVisitFees() {
return visitFees;
}
public void setVisitFees(double visitFees) {
this.visitFees = visitFees;
}
}
Please provide me SalariedEmployee.java class so i will update with it.
let me know any update requied.
Thank you
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.