Define a class named Doctor whose objects are records for a clinic’s doctors. Derive this class from the class Person given in Listing 8.1. 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, and an equals method as well. Write a driver program to test all your methods.

This project is a simple variation of Practice Program 1. Note that two of the Doctor constructors have the same two parameter types, String and double, but in opposite order, so they are clearly distinct to the compiler.


See the code in Doctor.java and DoctorTest.java.

Computer Science & Information Technology

You might also like to view...

The complete list of sources used in a paper that is typically added to the end of the document is called a(n) ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

To be successful with using ________ tools, keep them up to date and relevant to your customers

A) IaaS B) hashtags C) social media D) Google

Computer Science & Information Technology

Press Alt+________ to close a Windows 8 app

Fill in the blank(s) with correct word

Computer Science & Information Technology

To process data using post order processing:

a. Node is processed first, then the left branch, then the right. b. The left branch is processed first, then the node and then the right branch c. The left branch is processed first, then the right branch, and then the node d. The right branch is processed first, then the node, and then the left branch.

Computer Science & Information Technology