SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
Need uml diagram for this class please
public class GameItem {
private String name;
private int id;
private int strengthModifier;
private int speedModifier;
private int intelligenceModifier;
public GameItem(String name, int id, int strengthModifier, int speedModifier, int
intelligenceModifier) {
this.name = name;
this.id = id;
this.strengthModifier = strengthModifier;
this.speedModifier = speedModifier;
this.intelligenceModifier = intelligenceModifier;
}
public String getName() {
return name;
}
public int getId() {
return id;
}
public int getStrengthModifier() {
return strengthModifier;
}
public int getSpeedModifier() {
return speedModifier;
}
public int getIntelligenceModifier() {
return intelligenceModifier;
}
public void Comparison(GameItem c){
System.out.println("Item 1:ttItem 2:");
System.out.println(this.strengthModifier + "t |t" + c.strengthModifier);
System.out.println(this.speedModifier+ "t |t" + c.speedModifier);
System.out.println(this.intelligenceModifier + "t |t" + c.intelligenceModifier);
}
public boolean equals(GameItem other) {
return strengthModifier == other.strengthModifier && speedModifier == other.speedModifier
&& intelligenceModifier == other.intelligenceModifier;
}
// Declare a method that checks if two GameItems are duplicates
public boolean isDuplicate(GameItem other) {
return name.equals(other.name) && id == other.id && equals(other);
}
// Declare a method that creates a copy of a GameItem
public GameItem copy() {
return new GameItem(this.name, this.id, this.strengthModifier, this.speedModifier,
this.intelligenceModifier);
}
@Override
public String toString() {
return "GameItem{" + "name=" + name + ", id=" + id + ", strengthModifier=" +
strengthModifier + ", speedModifier=" + speedModifier + ", intelligenceModifier=" +
intelligenceModifier + '}';
}
}

Contenu connexe

Similaire à Need uml diagram for this class please public class GameItem { pr.pdf

So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
arihantgiftgallery
 
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docxI received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
walthamcoretta
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
AroraRajinder1
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
anwarsadath111
 
I really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdfI really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdf
aggarwalshoppe14
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
udit652068
 
Automobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdfAutomobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdf
anitasahani11
 
I really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdfI really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdf
aggarwalshoppe14
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
lakshmijewellery
 

Similaire à Need uml diagram for this class please public class GameItem { pr.pdf (20)

So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
 
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docxI received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
 
I really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdfI really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdf
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
 
Automobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdfAutomobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdf
 
I really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdfI really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdf
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
Creating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdfCreating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdf
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
 
Creating a Facebook Clone - Part XX - Transcript.pdf
Creating a Facebook Clone - Part XX - Transcript.pdfCreating a Facebook Clone - Part XX - Transcript.pdf
Creating a Facebook Clone - Part XX - Transcript.pdf
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Getting Started with the Amazon GameOn API - Peter Heinrich
Getting Started with the Amazon GameOn API - Peter HeinrichGetting Started with the Amazon GameOn API - Peter Heinrich
Getting Started with the Amazon GameOn API - Peter Heinrich
 
Design pattern - part 1
Design pattern - part 1Design pattern - part 1
Design pattern - part 1
 
Design pattern - part 3
Design pattern - part 3Design pattern - part 3
Design pattern - part 3
 
06slide.ppt
06slide.ppt06slide.ppt
06slide.ppt
 
a data driven game object system
a data driven game object systema data driven game object system
a data driven game object system
 
Flappy bird
Flappy birdFlappy bird
Flappy bird
 

Plus de aarzooabd

Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdfThirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
aarzooabd
 

Plus de aarzooabd (20)

Which of the following approaches is recommended to help users view a.pdf
Which of the following approaches is recommended to help users view a.pdfWhich of the following approaches is recommended to help users view a.pdf
Which of the following approaches is recommended to help users view a.pdf
 
What is the purpose of the assembler program- Group of answer choices.pdf
What is the purpose of the assembler program- Group of answer choices.pdfWhat is the purpose of the assembler program- Group of answer choices.pdf
What is the purpose of the assembler program- Group of answer choices.pdf
 
Using putty in Terminal- please write a code Create a country sub.pdf
Using putty in Terminal- please write a code      Create a country sub.pdfUsing putty in Terminal- please write a code      Create a country sub.pdf
Using putty in Terminal- please write a code Create a country sub.pdf
 
West MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdf
West MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdfWest MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdf
West MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdf
 
Using your own words- explain the difference between internal and exte.pdf
Using your own words- explain the difference between internal and exte.pdfUsing your own words- explain the difference between internal and exte.pdf
Using your own words- explain the difference between internal and exte.pdf
 
Unida Systems has 32 million shares outstanding trading for $ 10 per s.pdf
Unida Systems has 32 million shares outstanding trading for $ 10 per s.pdfUnida Systems has 32 million shares outstanding trading for $ 10 per s.pdf
Unida Systems has 32 million shares outstanding trading for $ 10 per s.pdf
 
Use the following diagram and information to answer the next question.pdf
Use the following diagram and information to answer the next question.pdfUse the following diagram and information to answer the next question.pdf
Use the following diagram and information to answer the next question.pdf
 
The workers' union at a particular university is quite strong- About 9.pdf
The workers' union at a particular university is quite strong- About 9.pdfThe workers' union at a particular university is quite strong- About 9.pdf
The workers' union at a particular university is quite strong- About 9.pdf
 
Two computers are connected together through their serial ports and Hy.pdf
Two computers are connected together through their serial ports and Hy.pdfTwo computers are connected together through their serial ports and Hy.pdf
Two computers are connected together through their serial ports and Hy.pdf
 
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdfThirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
 
The griffins from mythology are real! It has been discovered that 3 re.pdf
The griffins from mythology are real! It has been discovered that 3 re.pdfThe griffins from mythology are real! It has been discovered that 3 re.pdf
The griffins from mythology are real! It has been discovered that 3 re.pdf
 
The Taylors agreed to make monthly payments on a mortgage of $145-000.pdf
The Taylors agreed to make monthly payments on a mortgage of $145-000.pdfThe Taylors agreed to make monthly payments on a mortgage of $145-000.pdf
The Taylors agreed to make monthly payments on a mortgage of $145-000.pdf
 
The following code is a function to solicit three three integers from.pdf
The following code is a function to solicit three three integers from.pdfThe following code is a function to solicit three three integers from.pdf
The following code is a function to solicit three three integers from.pdf
 
The economy of Country A grows at a rate of 1-5 percent per year- The.pdf
The economy of Country A grows at a rate of 1-5 percent per year- The.pdfThe economy of Country A grows at a rate of 1-5 percent per year- The.pdf
The economy of Country A grows at a rate of 1-5 percent per year- The.pdf
 
Text and Garner reading from readings list- a- Darwin believed that th.pdf
Text and Garner reading from readings list- a- Darwin believed that th.pdfText and Garner reading from readings list- a- Darwin believed that th.pdf
Text and Garner reading from readings list- a- Darwin believed that th.pdf
 
If you grow cells that are just about to enter S phase in media contai.pdf
If you grow cells that are just about to enter S phase in media contai.pdfIf you grow cells that are just about to enter S phase in media contai.pdf
If you grow cells that are just about to enter S phase in media contai.pdf
 
Ida Sidha Karya Company is a family-owned company located in the villa.pdf
Ida Sidha Karya Company is a family-owned company located in the villa.pdfIda Sidha Karya Company is a family-owned company located in the villa.pdf
Ida Sidha Karya Company is a family-owned company located in the villa.pdf
 
2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf
2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf
2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf
 
Dichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdf
Dichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdfDichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdf
Dichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdf
 
I- Describe the kind of information that is required to model system r.pdf
I- Describe the kind of information that is required to model system r.pdfI- Describe the kind of information that is required to model system r.pdf
I- Describe the kind of information that is required to model system r.pdf
 

Dernier

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
heathfieldcps1
 

Dernier (20)

Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
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
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
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Ữ Â...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
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
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
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
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Need uml diagram for this class please public class GameItem { pr.pdf

  • 1. Need uml diagram for this class please public class GameItem { private String name; private int id; private int strengthModifier; private int speedModifier; private int intelligenceModifier; public GameItem(String name, int id, int strengthModifier, int speedModifier, int intelligenceModifier) { this.name = name; this.id = id; this.strengthModifier = strengthModifier; this.speedModifier = speedModifier; this.intelligenceModifier = intelligenceModifier; } public String getName() { return name; } public int getId() { return id; } public int getStrengthModifier() { return strengthModifier; } public int getSpeedModifier() { return speedModifier; } public int getIntelligenceModifier() { return intelligenceModifier; } public void Comparison(GameItem c){ System.out.println("Item 1:ttItem 2:"); System.out.println(this.strengthModifier + "t |t" + c.strengthModifier); System.out.println(this.speedModifier+ "t |t" + c.speedModifier); System.out.println(this.intelligenceModifier + "t |t" + c.intelligenceModifier); }
  • 2. public boolean equals(GameItem other) { return strengthModifier == other.strengthModifier && speedModifier == other.speedModifier && intelligenceModifier == other.intelligenceModifier; } // Declare a method that checks if two GameItems are duplicates public boolean isDuplicate(GameItem other) { return name.equals(other.name) && id == other.id && equals(other); } // Declare a method that creates a copy of a GameItem public GameItem copy() { return new GameItem(this.name, this.id, this.strengthModifier, this.speedModifier, this.intelligenceModifier); } @Override public String toString() { return "GameItem{" + "name=" + name + ", id=" + id + ", strengthModifier=" + strengthModifier + ", speedModifier=" + speedModifier + ", intelligenceModifier=" + intelligenceModifier + '}'; } }