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
Use HTML and CSS, create a web page for the table shown below. Please copy (and paste) your code from your text editor (Replit).
kenny6666 [7]
This is big sorry I can’t do it
6 0
3 years ago
Write a program in C++ to implement bubblesort using the swap function ?
marishachu [46]

C++ program for implementation of Bubble sort  

#include <bits/stdc++.h>  

using namespace std;  

 void swap(int *x, int *y)  /*Defining Swap function of void return type*/

{  

  int temp = *x;  //Swaping the values  

   *x = *y;  

   *y = temp;  

}  

void bubbleSort(int array[], int n) /*Defining function to implement bubbleSort  */

{  

  int i, j;  

  for (i = 0; i < n-1; i++)      

      for (j = 0; j < n-i-1; j++)  /*The last i components are already in location  */

      if (array[j] > array[j+1])  

          swap(&array[j], &array[j+1]);  //Calling swap function

}  

int main()  //driver function

{  

   int array[] = {3, 16, 7, 2, 56, 67, 8}; //Input array  

   int n = sizeof(array)/sizeof(array[0]);  //Finding size of array

   bubbleSort(array, n); //Function calling  

   cout<<"Sorted array: \n";  

   for (int i = 0; i < n; i++)  //printing the sorted array

       cout << array[i] << " ";  

   cout << endl;  

 return 0;  

}  

<u>Output</u>

Sorted array:  

2 3 7 8 16 56 67

3 0
4 years ago
Choose the correct term to complete the sentence
notka56 [123]

Answer:

popleft

Explanation:

5 0
3 years ago
What is a true job in the information age?​
Gelneren [198K]

Answer:

apple

you get a lot of information about the technology you paid for.

if this was not helpful comment and I’ll fix it!

3 0
3 years ago
What sorts of routine, seemingly unimportant information would help you learn about or break into another company’s network?
tatuchka [14]

Answer and Explanation:

  • Reboot your Computer from which you need to break into.
  • With your remote Ethernet card embedded and the unprotected passageway will mate up in a flash. You likewise need to change the Service Set Identifier (SSID) on your Ethernet card to coordinate SSID on the system's passage. You can decide to physically constrain your DHCP settings to reestablish, however on the off chance that that gives you any trouble.we need to re-boot it.
  • The Third Man ran a sniffer program that caught the majority of the LAN traffic within this organization. It was transmitted through the remote passageway straight into the Third Man's PC. Passwords. Agreements. Email.
4 0
4 years ago
Other questions:
  • On a DTP project, Morgan is preparing digital files to be sent to a printer. Which word describes the activity that Morgan is pe
    5·2 answers
  • What should not be compromised when trying to meet standards and deadlines?
    12·1 answer
  • I need a free flashdrive can anyone tell me any website links so i can get one for free????​
    11·1 answer
  • The document responsible for describing the type of data stored in the database is called the:
    5·1 answer
  • In bankruptcy, most of a debtor’s assets will probably be used to repay unsecured debt
    9·1 answer
  • What is the role of the federal government in regulating the media and the internet?
    6·2 answers
  • Given a list ` = (x1 x2 . . . xn−1 xn), we define two rotations of the list: The left-rotation is (x2 . . . xn−1 xn x1) and, lik
    12·1 answer
  • Your team has provisioned an Auto Scaling Groups in a single Region. The Auto Scaling Group at max capacity would total 40 EC2 i
    14·1 answer
  • How would you want to change the copyright laws?
    11·1 answer
  • What is an advantage of using a fully integrated cloud based data analytics platform
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!