Question: Write the Java code for the class Doctor based on the UML below and note the following: [1 marks] Declare all member variables as in

Write the Java code for the class Doctor based on the UML below and note the following:

[1 marks] Declare all member variables as in the UML. [1 mark] Write the constructor which takes 3 parameters to set the variables of the class Doctor. [1 mark] Write the setter and getter for the name attribute //Assume that the remaining setters and getters are implemented (Dont write them), and you can use them in other classes. [1.5 mark] write a method isSurgeon() that returns true if the speciality contains the word "surgery", and false otherwise. [1.5 mark] Write the toString() method which should return a string with Doctor name, Doctor ID and the specialty: For example: Dr. Mohamed Ahmad, ID: ENT4567, is specialized in: ENT-surgery

uml Doctor

-doctorID:String

-name:String

-speciality:String

+Doctor(String,String,String)

//+Getter and Setters

+isSurgeon (): boolean

+toString():String

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!