1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
algol13
3 years ago
14

Define a class named Doctor whose objects are records for a clinic’s doctors. Derive this class from the class Person given in L

esson. A Doctor record has the doctor’s name—defined in the class Person—a specialty as a string (for example Pediatrician, Obstetrician, General Practitioner, and so on), and an office-visit fee (use the type double). Give your class a reasonable complement of constructors and accessor methods. Write a driver program to test all your methods.
Computers and Technology
1 answer:
pashok25 [27]3 years ago
6 0

Answer:

Following is defined the required class having accessor methods and test program:

Explanation:

class Person

{

private String doc_name;

public Person(String doc_name)

{

this.doc_name = doc_name;

}

public String getDoc_Name()

{

return doc_name;

}

}

class Doctor extends Person

{

private double office_visit_fee;

private String Specialty;

public Doctor(String doc_name,double office_visit_fee,String Specialty)

{

super(doc_name);

this.office_visit_fee = office_visit_fee;

this.Specialty = Specialty;

}

//accessor methods

public double getOffice_Visit_Fee()

{

return office_visit_fee;

}

public String getSpecialty()

{

return Specialty;

}

public String toString()

{

return "Doctor Name "+getDoc_Name()+" Office Visit Fee :$"+office_visit_fee+

" Specialty : "+Specialty;

}

}

class Test

{

public static void main (String[] args)

{

 Doctor dctr = new Doctor("Joseph Lister",134.56,"Obstetrician");

 System.out.println(dctr);

}

}

Output:

Doctor Name Joseph Lister Office Visit Fee :$134.56 Speciality : Obstetrician

You might be interested in
Using complete sentences post a detailed response to the following.
german

Answer:

Some guidelines on how to share information in a public space are to credit the owner of the picture, article, etc that are being used. If you want to use someone else's photo or song in one of your own projects, you'll need to make sure you have the legal right to do so before hand. According to copyright law, any original content you create and record in a lasting form is your own intellectual property. This means other people can't legally copy your work and pretend it's their own. They can't make money from the things you create either.

Explanation:

I hope this helps. please don't copy.

4 0
3 years ago
Read 2 more answers
This type of program is designed to be transmitted over the internet and run in a web browser
vodomira [7]
This sounds like a web-based application because they are designed to be ran within a website, generally with Adobe Flash.
8 0
3 years ago
What are the six things you will learn this week on Scratch?
notka56 [123]

Answer:

1 You can learn to draw

2 You can learn to code

3 You can learn to make a thumbnail

4 You can learn how to follow yourself

5 You can learn  to remix your own projects

6 You can learn how to make a featured project you've never shared

Explanation:

8 0
3 years ago
Julie I'm here so help me I'm red
aniked [119]

Answer:

hey hey hey hey hey hey hey hey

Explanation:

hey hey hey hey hey hey hey hey

7 0
4 years ago
What query class will you choose<br> for this query "women are evil"?
nikklg [1K]

Answer:

A) Gibberish or Vague Profane

Explanation:

Hope this helps

7 0
2 years ago
Other questions:
  • Write a function called calculate() that accepts three integer Numbers as arguments, compute these values : Sum and Product and
    7·1 answer
  • Data ____________ refers to any technique that recodes the data in a file so that it contains fewer bits.​
    10·1 answer
  • List the six external peripheral parts of a computer system
    8·1 answer
  • Is an architecture where a client runs an applications provided by a server on a network
    7·1 answer
  • A system analyst generally needs to have a number of skills. For example, technical and analytical skills are required for this
    7·1 answer
  • How could you represent the following binary color in hexadecimal? What is its numerical value? What color is it? How
    13·1 answer
  • if you are trying to reduce the cost of college, which of the following strategies is likely to save you the most money?
    9·1 answer
  • A chip that wakes up the computer system
    10·1 answer
  • I am trying to do a python code quiz for school, the basic requirements for the quiz are: the quiz MUST have 10 questions
    15·2 answers
  • 1.1 give five (5) reasons why modeling is an important part of system analysis and design
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!