SlideShare a Scribd company logo
1 of 1
Download to read offline
Person.java is given
Solution
Since I didn't have the implementation of the Disease class, I made some assumptions and wrote
the code accordingly.
public class Person{
public final String name;
protected int health;
protected Disease[] diseases;
public Person(String name, int health){
this.name = name;
this.health = health;
}
public int getHealth(){
return this.health;
}
public void addDisease(Disease dis){
if (!diseasePresent(dis)){
Disease[] updated_diseases[diseases.length+1] = new Disease[];
for (int i<0; i

More Related Content

More from kellenaowardstrigl34

The portion of the fungus that projects above the substrate and conta.pdf
The portion of the fungus that projects above the substrate and conta.pdfThe portion of the fungus that projects above the substrate and conta.pdf
The portion of the fungus that projects above the substrate and conta.pdfkellenaowardstrigl34
 
the appearance of symptoms of a genetic disorder at earlier ages in .pdf
the appearance of symptoms of a genetic disorder at earlier ages in .pdfthe appearance of symptoms of a genetic disorder at earlier ages in .pdf
the appearance of symptoms of a genetic disorder at earlier ages in .pdfkellenaowardstrigl34
 
Stuck on hw problem Assume that the forces acting on a mass are such.pdf
Stuck on hw problem Assume that the forces acting on a mass are such.pdfStuck on hw problem Assume that the forces acting on a mass are such.pdf
Stuck on hw problem Assume that the forces acting on a mass are such.pdfkellenaowardstrigl34
 
Some Giant Sulphur Bacteria are so large as to be visible to the nak.pdf
Some Giant Sulphur Bacteria are so large as to be visible to the nak.pdfSome Giant Sulphur Bacteria are so large as to be visible to the nak.pdf
Some Giant Sulphur Bacteria are so large as to be visible to the nak.pdfkellenaowardstrigl34
 
right now I am using a l293d chip to control my DC motor which is 6 .pdf
right now I am using a l293d chip to control my DC motor which is 6 .pdfright now I am using a l293d chip to control my DC motor which is 6 .pdf
right now I am using a l293d chip to control my DC motor which is 6 .pdfkellenaowardstrigl34
 
Problem 1 Eclipses and occults Saturn has five satellites that rotat.pdf
Problem 1 Eclipses and occults Saturn has five satellites that rotat.pdfProblem 1 Eclipses and occults Saturn has five satellites that rotat.pdf
Problem 1 Eclipses and occults Saturn has five satellites that rotat.pdfkellenaowardstrigl34
 
please show work A hospital reports that two patients have been admi.pdf
please show work A hospital reports that two patients have been admi.pdfplease show work A hospital reports that two patients have been admi.pdf
please show work A hospital reports that two patients have been admi.pdfkellenaowardstrigl34
 
In java languageWhich of the following is falseA) A JPasswordFi.pdf
In java languageWhich of the following is falseA) A JPasswordFi.pdfIn java languageWhich of the following is falseA) A JPasswordFi.pdf
In java languageWhich of the following is falseA) A JPasswordFi.pdfkellenaowardstrigl34
 
in a completely randomized (one-way) anova, with other things being .pdf
in a completely randomized (one-way) anova, with other things being .pdfin a completely randomized (one-way) anova, with other things being .pdf
in a completely randomized (one-way) anova, with other things being .pdfkellenaowardstrigl34
 
I want you to go the Next Generation Sunshine State standards (http.pdf
I want you to go the Next Generation Sunshine State standards (http.pdfI want you to go the Next Generation Sunshine State standards (http.pdf
I want you to go the Next Generation Sunshine State standards (http.pdfkellenaowardstrigl34
 
How are macromolecules transported across the nuclear envelope Desc.pdf
How are macromolecules transported across the nuclear envelope Desc.pdfHow are macromolecules transported across the nuclear envelope Desc.pdf
How are macromolecules transported across the nuclear envelope Desc.pdfkellenaowardstrigl34
 
GeneticsBackground info About 30 of the Irish population has red.pdf
GeneticsBackground info About 30 of the Irish population has red.pdfGeneticsBackground info About 30 of the Irish population has red.pdf
GeneticsBackground info About 30 of the Irish population has red.pdfkellenaowardstrigl34
 
Fishes are at the base of the vertebrate Tree of Life and fishes do .pdf
Fishes are at the base of the vertebrate Tree of Life and fishes do .pdfFishes are at the base of the vertebrate Tree of Life and fishes do .pdf
Fishes are at the base of the vertebrate Tree of Life and fishes do .pdfkellenaowardstrigl34
 
Consider two point sources separated by a distance of 10 meters. The .pdf
Consider two point sources separated by a distance of 10 meters. The .pdfConsider two point sources separated by a distance of 10 meters. The .pdf
Consider two point sources separated by a distance of 10 meters. The .pdfkellenaowardstrigl34
 
Consider the following system microprocessor based system Program t.pdf
Consider the following system microprocessor based system  Program t.pdfConsider the following system microprocessor based system  Program t.pdf
Consider the following system microprocessor based system Program t.pdfkellenaowardstrigl34
 
Develop an algorithm for the 4-sum problem.SolutionThe algorit.pdf
Develop an algorithm for the 4-sum problem.SolutionThe algorit.pdfDevelop an algorithm for the 4-sum problem.SolutionThe algorit.pdf
Develop an algorithm for the 4-sum problem.SolutionThe algorit.pdfkellenaowardstrigl34
 
Describe the repair mechanisms used during DNA replication.Soluti.pdf
Describe the repair mechanisms used during DNA replication.Soluti.pdfDescribe the repair mechanisms used during DNA replication.Soluti.pdf
Describe the repair mechanisms used during DNA replication.Soluti.pdfkellenaowardstrigl34
 
Describe the current state of the human beta globin gene family and .pdf
Describe the current state of the human beta globin gene family and .pdfDescribe the current state of the human beta globin gene family and .pdf
Describe the current state of the human beta globin gene family and .pdfkellenaowardstrigl34
 
Derived characteristics that define the order Primate include    a.pdf
Derived characteristics that define the order Primate include    a.pdfDerived characteristics that define the order Primate include    a.pdf
Derived characteristics that define the order Primate include    a.pdfkellenaowardstrigl34
 
Consider the (Mining dataset shown in the following table The las.pdf
Consider the (Mining dataset shown in the following table The las.pdfConsider the (Mining dataset shown in the following table The las.pdf
Consider the (Mining dataset shown in the following table The las.pdfkellenaowardstrigl34
 

More from kellenaowardstrigl34 (20)

The portion of the fungus that projects above the substrate and conta.pdf
The portion of the fungus that projects above the substrate and conta.pdfThe portion of the fungus that projects above the substrate and conta.pdf
The portion of the fungus that projects above the substrate and conta.pdf
 
the appearance of symptoms of a genetic disorder at earlier ages in .pdf
the appearance of symptoms of a genetic disorder at earlier ages in .pdfthe appearance of symptoms of a genetic disorder at earlier ages in .pdf
the appearance of symptoms of a genetic disorder at earlier ages in .pdf
 
Stuck on hw problem Assume that the forces acting on a mass are such.pdf
Stuck on hw problem Assume that the forces acting on a mass are such.pdfStuck on hw problem Assume that the forces acting on a mass are such.pdf
Stuck on hw problem Assume that the forces acting on a mass are such.pdf
 
Some Giant Sulphur Bacteria are so large as to be visible to the nak.pdf
Some Giant Sulphur Bacteria are so large as to be visible to the nak.pdfSome Giant Sulphur Bacteria are so large as to be visible to the nak.pdf
Some Giant Sulphur Bacteria are so large as to be visible to the nak.pdf
 
right now I am using a l293d chip to control my DC motor which is 6 .pdf
right now I am using a l293d chip to control my DC motor which is 6 .pdfright now I am using a l293d chip to control my DC motor which is 6 .pdf
right now I am using a l293d chip to control my DC motor which is 6 .pdf
 
Problem 1 Eclipses and occults Saturn has five satellites that rotat.pdf
Problem 1 Eclipses and occults Saturn has five satellites that rotat.pdfProblem 1 Eclipses and occults Saturn has five satellites that rotat.pdf
Problem 1 Eclipses and occults Saturn has five satellites that rotat.pdf
 
please show work A hospital reports that two patients have been admi.pdf
please show work A hospital reports that two patients have been admi.pdfplease show work A hospital reports that two patients have been admi.pdf
please show work A hospital reports that two patients have been admi.pdf
 
In java languageWhich of the following is falseA) A JPasswordFi.pdf
In java languageWhich of the following is falseA) A JPasswordFi.pdfIn java languageWhich of the following is falseA) A JPasswordFi.pdf
In java languageWhich of the following is falseA) A JPasswordFi.pdf
 
in a completely randomized (one-way) anova, with other things being .pdf
in a completely randomized (one-way) anova, with other things being .pdfin a completely randomized (one-way) anova, with other things being .pdf
in a completely randomized (one-way) anova, with other things being .pdf
 
I want you to go the Next Generation Sunshine State standards (http.pdf
I want you to go the Next Generation Sunshine State standards (http.pdfI want you to go the Next Generation Sunshine State standards (http.pdf
I want you to go the Next Generation Sunshine State standards (http.pdf
 
How are macromolecules transported across the nuclear envelope Desc.pdf
How are macromolecules transported across the nuclear envelope Desc.pdfHow are macromolecules transported across the nuclear envelope Desc.pdf
How are macromolecules transported across the nuclear envelope Desc.pdf
 
GeneticsBackground info About 30 of the Irish population has red.pdf
GeneticsBackground info About 30 of the Irish population has red.pdfGeneticsBackground info About 30 of the Irish population has red.pdf
GeneticsBackground info About 30 of the Irish population has red.pdf
 
Fishes are at the base of the vertebrate Tree of Life and fishes do .pdf
Fishes are at the base of the vertebrate Tree of Life and fishes do .pdfFishes are at the base of the vertebrate Tree of Life and fishes do .pdf
Fishes are at the base of the vertebrate Tree of Life and fishes do .pdf
 
Consider two point sources separated by a distance of 10 meters. The .pdf
Consider two point sources separated by a distance of 10 meters. The .pdfConsider two point sources separated by a distance of 10 meters. The .pdf
Consider two point sources separated by a distance of 10 meters. The .pdf
 
Consider the following system microprocessor based system Program t.pdf
Consider the following system microprocessor based system  Program t.pdfConsider the following system microprocessor based system  Program t.pdf
Consider the following system microprocessor based system Program t.pdf
 
Develop an algorithm for the 4-sum problem.SolutionThe algorit.pdf
Develop an algorithm for the 4-sum problem.SolutionThe algorit.pdfDevelop an algorithm for the 4-sum problem.SolutionThe algorit.pdf
Develop an algorithm for the 4-sum problem.SolutionThe algorit.pdf
 
Describe the repair mechanisms used during DNA replication.Soluti.pdf
Describe the repair mechanisms used during DNA replication.Soluti.pdfDescribe the repair mechanisms used during DNA replication.Soluti.pdf
Describe the repair mechanisms used during DNA replication.Soluti.pdf
 
Describe the current state of the human beta globin gene family and .pdf
Describe the current state of the human beta globin gene family and .pdfDescribe the current state of the human beta globin gene family and .pdf
Describe the current state of the human beta globin gene family and .pdf
 
Derived characteristics that define the order Primate include    a.pdf
Derived characteristics that define the order Primate include    a.pdfDerived characteristics that define the order Primate include    a.pdf
Derived characteristics that define the order Primate include    a.pdf
 
Consider the (Mining dataset shown in the following table The las.pdf
Consider the (Mining dataset shown in the following table The las.pdfConsider the (Mining dataset shown in the following table The las.pdf
Consider the (Mining dataset shown in the following table The las.pdf
 

Recently uploaded

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 

Recently uploaded (20)

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

Person.java is givenSolutionSince I didnt have the implement.pdf

  • 1. Person.java is given Solution Since I didn't have the implementation of the Disease class, I made some assumptions and wrote the code accordingly. public class Person{ public final String name; protected int health; protected Disease[] diseases; public Person(String name, int health){ this.name = name; this.health = health; } public int getHealth(){ return this.health; } public void addDisease(Disease dis){ if (!diseasePresent(dis)){ Disease[] updated_diseases[diseases.length+1] = new Disease[]; for (int i<0; i