Question: Answer This Question In Java Completely And Correctly OR YOU GET DOWNVOTED AND REPORTED Question 1 (Total 36 Marks): Consider the UML diagram below which

Answer This Question In Java Completely And Correctly OR YOU GET DOWNVOTED AND REPORTED
Answer This Question In Java Completely And Correctly OR YOU GET DOWNVOTED

Question 1 (Total 36 Marks): Consider the UML diagram below which describes patients in a hospital. The patient can be in hospital to be treated from 1 or more diseases. Each disease is caused by one of two: either a virus or a microbe. The hospital can hold many patients up to MAXNum patients. In this scope do the following: a) Write the java code which implements the given UML diagram. (12 marks) b) Apply Encapsulation concept to class Person and Patient. (2 marks) c) In all classes add default constructor to initialize each. (4 marks) d) In both classes Person and Patient add parameter-based constructor to initialize each. (4 marks) e) In both classes Person and Patient add a copy constructor to initialize it. (4 marks) f) In all classes add toString 0 method (4 marks) g) It is required to include a new class named Doctor. The doctor is a Person who can be a patient and accordingly can be treated from number of diseases. Add necessary java code to implement class doctor. (4 marks) h) Illustrate your answer in part g using uml. (2 marks)

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!