Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A: Given the following UML diagram of two classes Doctor within a hospital management program, answer the following questions: Doctor -doctorID:String -name:String -speciality:String +Doctor(String,String,String) //+Getter

A: Given the following UML diagram of two classes Doctor within a hospital management program, answer the following questions:

Doctor

-doctorID:String

-name:String

-speciality:String

+Doctor(String,String,String)

//+Getter and Setters

+isSurgeon (): boolean

+toString():String

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

[1 marks] Declare all member variables as in the UML.

[1 mark] Write the constructors which takes 3 parameters to set the variable 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 doctor practices any kind of surgery, and false otherwise.

[1.5 mark] Write the toString() method which should return a string with Doctor name, Doctor ID and it specialty: For example:

Dr. Mohamed Ahmad, ID: ENT4567, is specialized in: ENT-surgery

with java languge

with java languge

with java languge

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago

Question

Define induction and what are its objectives ?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago