Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed
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

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

=+j Understand different types of regions in the world.

Answered: 1 week ago