Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java A patient can have one or more illnesses. An illness has an illness Name and and illness department. a. Define a class called

in java
image text in transcribed
A patient can have one or more illnesses. An illness has an illness Name and and illness department. a. Define a class called Iliness with appropriate fields and provide the required constructor, accessor (get) and mutator (set) methods. You should also consider the relationship between the Patient and Illness classes. b. Modify the main program developed in Exercise 1c such that, for each Patient who has illnesses, the program prompts the user to enter the illnesse's name and department. c. Modify the main program to give the user the options to do the following: 1. Print details of all patients including the illnesses they have. 2. Print the details of the patients who have illnesses. Each patient on two lines: one for the patient and one for his/her illnesses. 3. Print the names of the patients who have more than 1 illness. 4. Exit the program. Note: Please show all the options in your output screenshot

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 Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions