SlideShare a Scribd company logo
1 of 7
Download to read offline
Need a UMLL diagram for these 3 classes please i will like and comment
public class OOP_Ass1 {
public static void main(String[] args) {
GameItem sword = new GameItem("Sword", 1, 10, 5, 0);
GameItem magicStaff = new GameItem("Magic Staff", 2, 0, 10, 5);
Character c1 = new Character("Omar",2231,12,15,44,sword);
Character c2 = new Character("Ahmed",11441,30,40,1000,magicStaff);
c1.Comparison(c2);
System.out.println("Equal? "+c1.equals(c2));
System.out.println("Dublicate? "+c1.dublicate(c2));
Character c3 = new Character(c2);
System.out.println("Copied: "+c3);
System.out.println("");
sword.Comparison(magicStaff);
System.out.println("Equal? " + sword.equals(magicStaff));
GameItem swordDuplicate = new GameItem("Sword", 50, 10, 55, 0);
System.out.println("Duplicate? " + sword.isDuplicate(swordDuplicate));
GameItem swordCopy = sword.copy();
System.out.println("Copied: " + swordCopy);
System.out.println("The expected winner is: "+c1.expectedWinner(c2));
}
}
/////////////////////////
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 + '}';
}
}
/////////////////////////////////////////
public class Character {
private String name;
private int id;
private int strength;
private int speed;
private int intelligence;
private GameItem g;
public Character(){
name = "0";
id = 0;
strength = 0;
speed = 0;
intelligence = 0;
}
public GameItem getG() {
return g;
}
public void setG(GameItem g) {
this.g = g;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getStrength() {
return strength;
}
public int getTotalStrength(){
int total = strength + g.getStrengthModifier();
if (total > 100)
return 100;
return total;
}
public void setStrength(int strength) {
if (strength <= 0)
this.strength = 0;
else if(strength >= 100)
this.strength = 100;
else
this.strength = strength;
}
public int getSpeed() {
return speed;
}
public int getTotalSpeed(){
int total = speed + g.getSpeedModifier();
if (total > 100)
return 100;
return total;
}
public void setSpeed(int speed) {
if (speed <= 0)
this.speed = 0;
else if(speed >= 100)
this.speed = 100;
else
this.speed = speed;
}
public int getIntelligence() {
return intelligence;
}
public int getTotalIntelligence(){
int total = intelligence + g.getIntelligenceModifier();
if (total > 100)
return 100;
return total;
}
public void setIntelligence(int intelligence) {
if (intelligence <= 0)
this.intelligence = 0;
else if(intelligence >= 100)
this.intelligence = 100;
else
this.intelligence = intelligence;
}
public Character(String name, int id ,int i , int sp, int st,GameItem g){
this.setId(id);
this.setName(name);
this.setIntelligence(i);
this.setSpeed(sp);
this.setStrength(st);
this.setG(g);
}
public boolean equals(Character c2){
return this.getStrength() == c2.getStrength() &&
this.getSpeed() == c2.getSpeed() &&
this.getIntelligence() == c2.getIntelligence();
}
public boolean dublicate(Character c2){
return (this.name.equalsIgnoreCase(c2.name) &&
this.id == c2.id &&
this.intelligence == c2.intelligence &&
this.speed == c2.speed &&
this.strength == c2.strength);
}
public void Comparison(Character c){
System.out.println("Character 1:tCharacter 2:");
System.out.println(this.getTotalStrength() + "t |t" + c.getTotalStrength());
System.out.println(this.getTotalSpeed() + "t |t" + c.getTotalSpeed());
System.out.println(this.getTotalIntelligence() + "t |t" + c.getTotalIntelligence());
}
//Ask prof what is the gameitem
public Character(Character c1){
this.name = c1.name;
this.id = c1.id;
this.intelligence = c1.intelligence;
this.speed = c1.speed;
this.strength = c1.strength;
this.g = c1.g;
}
public Character expectedWinner(Character other) {
double avgStats = (this.getTotalStrength() + this.getTotalSpeed() + this.getTotalIntelligence()) /
3.0;
double otherAvgStats = (other.getTotalStrength() + other.getTotalSpeed() +
other.getTotalIntelligence()) / 3.0;
if (avgStats > otherAvgStats)
return this;
else
return other;
}
@Override
public String toString() {
return "Character{" + "name=" + name + ", id=" + id + ", strength=" + strength + ", speed=" +
speed + ", intelligence=" + intelligence + ", g=" + g + '}';
}
}
UML diagram please i will like and comment 3 CLASSES

More Related Content

Similar to Need a UMLL diagram for these 3 classes please i will like and comment.pdf

Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2MEJenchoke Tachagomain
 
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 DetectionJenchoke Tachagomain
 
Modular games in Unity / Paweł Krakowiak (Rage Quit Games)
Modular games in Unity / Paweł Krakowiak (Rage Quit Games)Modular games in Unity / Paweł Krakowiak (Rage Quit Games)
Modular games in Unity / Paweł Krakowiak (Rage Quit Games)DevGAMM Conference
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScriptSam Cartwright
 
FileName EX06_1java Programmer import ja.pdf
FileName EX06_1java Programmer  import ja.pdfFileName EX06_1java Programmer  import ja.pdf
FileName EX06_1java Programmer import ja.pdfactocomputer
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsAlfonso Peletier
 
Team public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdfTeam public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdfDEEPAKSONI562
 
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.pdfAroraRajinder1
 
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdfIfgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdffazilfootsteps
 
QA Auotmation Java programs,theory
QA Auotmation Java programs,theory QA Auotmation Java programs,theory
QA Auotmation Java programs,theory archana singh
 
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdfObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdfrajkumarm401
 
You will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfYou will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfFashionColZone
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfarchanaemporium
 
package com.test;public class Team {    private String teamId;.pdf
package com.test;public class Team {    private String teamId;.pdfpackage com.test;public class Team {    private String teamId;.pdf
package com.test;public class Team {    private String teamId;.pdfaparnacollection
 
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84Mahmoud Samir Fayed
 
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.pdfudit652068
 
Please help me make a UML for Java! Look at the code below and make a.docx
Please help me make a UML for Java! Look at the code below and make a.docxPlease help me make a UML for Java! Look at the code below and make a.docx
Please help me make a UML for Java! Look at the code below and make a.docxJakeT2gGrayp
 

Similar to Need a UMLL diagram for these 3 classes please i will like and comment.pdf (20)

Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
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
 
Modular games in Unity / Paweł Krakowiak (Rage Quit Games)
Modular games in Unity / Paweł Krakowiak (Rage Quit Games)Modular games in Unity / Paweł Krakowiak (Rage Quit Games)
Modular games in Unity / Paweł Krakowiak (Rage Quit Games)
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScript
 
FileName EX06_1java Programmer import ja.pdf
FileName EX06_1java Programmer  import ja.pdfFileName EX06_1java Programmer  import ja.pdf
FileName EX06_1java Programmer import ja.pdf
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
 
Team public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdfTeam public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdf
 
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
 
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdfIfgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
 
QA Auotmation Java programs,theory
QA Auotmation Java programs,theory QA Auotmation Java programs,theory
QA Auotmation Java programs,theory
 
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdfObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
ObjectiveCreate a graphical game of minesweeper IN JAVA. The boar.pdf
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
Flappy bird
Flappy birdFlappy bird
Flappy bird
 
You will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfYou will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdf
 
I dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdfI dont know what is wrong with this roulette program I cant seem.pdf
I dont know what is wrong with this roulette program I cant seem.pdf
 
package com.test;public class Team {    private String teamId;.pdf
package com.test;public class Team {    private String teamId;.pdfpackage com.test;public class Team {    private String teamId;.pdf
package com.test;public class Team {    private String teamId;.pdf
 
The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84The Ring programming language version 1.2 book - Part 38 of 84
The Ring programming language version 1.2 book - Part 38 of 84
 
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
 
J slider
J sliderJ slider
J slider
 
Please help me make a UML for Java! Look at the code below and make a.docx
Please help me make a UML for Java! Look at the code below and make a.docxPlease help me make a UML for Java! Look at the code below and make a.docx
Please help me make a UML for Java! Look at the code below and make a.docx
 

More from aartiwomensworld

If data is positively skewed then a) mean mode b) mean mode C) range.pdf
If data is positively skewed then a) mean  mode b) mean  mode C) range.pdfIf data is positively skewed then a) mean  mode b) mean  mode C) range.pdf
If data is positively skewed then a) mean mode b) mean mode C) range.pdfaartiwomensworld
 
I need the code to be done using processing- or Java The program creat.pdf
I need the code to be done using processing- or Java The program creat.pdfI need the code to be done using processing- or Java The program creat.pdf
I need the code to be done using processing- or Java The program creat.pdfaartiwomensworld
 
Examine the graph from Ammann & Offutt (2015) relating to the cost of.pdf
Examine the graph from Ammann & Offutt (2015) relating to the cost of.pdfExamine the graph from Ammann & Offutt (2015) relating to the cost of.pdf
Examine the graph from Ammann & Offutt (2015) relating to the cost of.pdfaartiwomensworld
 
af Moving to another question will save this response- Question 6 Whic.pdf
af Moving to another question will save this response- Question 6 Whic.pdfaf Moving to another question will save this response- Question 6 Whic.pdf
af Moving to another question will save this response- Question 6 Whic.pdfaartiwomensworld
 
C++ The following function inserts an integer- value- into an array of.pdf
C++ The following function inserts an integer- value- into an array of.pdfC++ The following function inserts an integer- value- into an array of.pdf
C++ The following function inserts an integer- value- into an array of.pdfaartiwomensworld
 
During Durton Company's first two years of operations- the company rep.pdf
During Durton Company's first two years of operations- the company rep.pdfDuring Durton Company's first two years of operations- the company rep.pdf
During Durton Company's first two years of operations- the company rep.pdfaartiwomensworld
 
A nutrient dense food is- A measure of the nutrients provided in a foo.pdf
A nutrient dense food is- A measure of the nutrients provided in a foo.pdfA nutrient dense food is- A measure of the nutrients provided in a foo.pdf
A nutrient dense food is- A measure of the nutrients provided in a foo.pdfaartiwomensworld
 
Determine the amount of the late filing and late payment penalties tha (1).pdf
Determine the amount of the late filing and late payment penalties tha (1).pdfDetermine the amount of the late filing and late payment penalties tha (1).pdf
Determine the amount of the late filing and late payment penalties tha (1).pdfaartiwomensworld
 
What's a discrete probability distribution- Group of answer choices Th.pdf
What's a discrete probability distribution- Group of answer choices Th.pdfWhat's a discrete probability distribution- Group of answer choices Th.pdf
What's a discrete probability distribution- Group of answer choices Th.pdfaartiwomensworld
 
value of the annual dividend that is expected in 4 years from today-(R.pdf
value of the annual dividend that is expected in 4 years from today-(R.pdfvalue of the annual dividend that is expected in 4 years from today-(R.pdf
value of the annual dividend that is expected in 4 years from today-(R.pdfaartiwomensworld
 
This lab bench displays the different means of growing bacterial cultu.pdf
This lab bench displays the different means of growing bacterial cultu.pdfThis lab bench displays the different means of growing bacterial cultu.pdf
This lab bench displays the different means of growing bacterial cultu.pdfaartiwomensworld
 
The National Report on Human Exposure to Environmental Chemicals (Repo.pdf
The National Report on Human Exposure to Environmental Chemicals (Repo.pdfThe National Report on Human Exposure to Environmental Chemicals (Repo.pdf
The National Report on Human Exposure to Environmental Chemicals (Repo.pdfaartiwomensworld
 
21) Clouded leopards are a spotted cat- The spots can either be normal.pdf
21) Clouded leopards are a spotted cat- The spots can either be normal.pdf21) Clouded leopards are a spotted cat- The spots can either be normal.pdf
21) Clouded leopards are a spotted cat- The spots can either be normal.pdfaartiwomensworld
 
Suppose that the government runs a strong budget surplus- At the same.pdf
Suppose that the government runs a strong budget surplus- At the same.pdfSuppose that the government runs a strong budget surplus- At the same.pdf
Suppose that the government runs a strong budget surplus- At the same.pdfaartiwomensworld
 
Question 1 1pts The length of time taken on the SAT is normally distri.pdf
Question 1 1pts The length of time taken on the SAT is normally distri.pdfQuestion 1 1pts The length of time taken on the SAT is normally distri.pdf
Question 1 1pts The length of time taken on the SAT is normally distri.pdfaartiwomensworld
 
Q1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdf
Q1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdfQ1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdf
Q1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdfaartiwomensworld
 
please answer the questions after the a-b-c-and d part You are to dis.pdf
please answer the questions after the a-b-c-and d part  You are to dis.pdfplease answer the questions after the a-b-c-and d part  You are to dis.pdf
please answer the questions after the a-b-c-and d part You are to dis.pdfaartiwomensworld
 
MGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdf
MGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdfMGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdf
MGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdfaartiwomensworld
 
Mixing Saturation occasionally occurs when two air masses mix- Mixing.pdf
Mixing Saturation occasionally occurs when two air masses mix- Mixing.pdfMixing Saturation occasionally occurs when two air masses mix- Mixing.pdf
Mixing Saturation occasionally occurs when two air masses mix- Mixing.pdfaartiwomensworld
 

More from aartiwomensworld (19)

If data is positively skewed then a) mean mode b) mean mode C) range.pdf
If data is positively skewed then a) mean  mode b) mean  mode C) range.pdfIf data is positively skewed then a) mean  mode b) mean  mode C) range.pdf
If data is positively skewed then a) mean mode b) mean mode C) range.pdf
 
I need the code to be done using processing- or Java The program creat.pdf
I need the code to be done using processing- or Java The program creat.pdfI need the code to be done using processing- or Java The program creat.pdf
I need the code to be done using processing- or Java The program creat.pdf
 
Examine the graph from Ammann & Offutt (2015) relating to the cost of.pdf
Examine the graph from Ammann & Offutt (2015) relating to the cost of.pdfExamine the graph from Ammann & Offutt (2015) relating to the cost of.pdf
Examine the graph from Ammann & Offutt (2015) relating to the cost of.pdf
 
af Moving to another question will save this response- Question 6 Whic.pdf
af Moving to another question will save this response- Question 6 Whic.pdfaf Moving to another question will save this response- Question 6 Whic.pdf
af Moving to another question will save this response- Question 6 Whic.pdf
 
C++ The following function inserts an integer- value- into an array of.pdf
C++ The following function inserts an integer- value- into an array of.pdfC++ The following function inserts an integer- value- into an array of.pdf
C++ The following function inserts an integer- value- into an array of.pdf
 
During Durton Company's first two years of operations- the company rep.pdf
During Durton Company's first two years of operations- the company rep.pdfDuring Durton Company's first two years of operations- the company rep.pdf
During Durton Company's first two years of operations- the company rep.pdf
 
A nutrient dense food is- A measure of the nutrients provided in a foo.pdf
A nutrient dense food is- A measure of the nutrients provided in a foo.pdfA nutrient dense food is- A measure of the nutrients provided in a foo.pdf
A nutrient dense food is- A measure of the nutrients provided in a foo.pdf
 
Determine the amount of the late filing and late payment penalties tha (1).pdf
Determine the amount of the late filing and late payment penalties tha (1).pdfDetermine the amount of the late filing and late payment penalties tha (1).pdf
Determine the amount of the late filing and late payment penalties tha (1).pdf
 
What's a discrete probability distribution- Group of answer choices Th.pdf
What's a discrete probability distribution- Group of answer choices Th.pdfWhat's a discrete probability distribution- Group of answer choices Th.pdf
What's a discrete probability distribution- Group of answer choices Th.pdf
 
value of the annual dividend that is expected in 4 years from today-(R.pdf
value of the annual dividend that is expected in 4 years from today-(R.pdfvalue of the annual dividend that is expected in 4 years from today-(R.pdf
value of the annual dividend that is expected in 4 years from today-(R.pdf
 
This lab bench displays the different means of growing bacterial cultu.pdf
This lab bench displays the different means of growing bacterial cultu.pdfThis lab bench displays the different means of growing bacterial cultu.pdf
This lab bench displays the different means of growing bacterial cultu.pdf
 
The National Report on Human Exposure to Environmental Chemicals (Repo.pdf
The National Report on Human Exposure to Environmental Chemicals (Repo.pdfThe National Report on Human Exposure to Environmental Chemicals (Repo.pdf
The National Report on Human Exposure to Environmental Chemicals (Repo.pdf
 
21) Clouded leopards are a spotted cat- The spots can either be normal.pdf
21) Clouded leopards are a spotted cat- The spots can either be normal.pdf21) Clouded leopards are a spotted cat- The spots can either be normal.pdf
21) Clouded leopards are a spotted cat- The spots can either be normal.pdf
 
Suppose that the government runs a strong budget surplus- At the same.pdf
Suppose that the government runs a strong budget surplus- At the same.pdfSuppose that the government runs a strong budget surplus- At the same.pdf
Suppose that the government runs a strong budget surplus- At the same.pdf
 
Question 1 1pts The length of time taken on the SAT is normally distri.pdf
Question 1 1pts The length of time taken on the SAT is normally distri.pdfQuestion 1 1pts The length of time taken on the SAT is normally distri.pdf
Question 1 1pts The length of time taken on the SAT is normally distri.pdf
 
Q1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdf
Q1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdfQ1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdf
Q1- Let X-{X1-X2--Xn} be an independent random sample from a uniformly.pdf
 
please answer the questions after the a-b-c-and d part You are to dis.pdf
please answer the questions after the a-b-c-and d part  You are to dis.pdfplease answer the questions after the a-b-c-and d part  You are to dis.pdf
please answer the questions after the a-b-c-and d part You are to dis.pdf
 
MGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdf
MGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdfMGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdf
MGT - D2Q1 Imagine yourself as the CEO of a large firm in an industry.pdf
 
Mixing Saturation occasionally occurs when two air masses mix- Mixing.pdf
Mixing Saturation occasionally occurs when two air masses mix- Mixing.pdfMixing Saturation occasionally occurs when two air masses mix- Mixing.pdf
Mixing Saturation occasionally occurs when two air masses mix- Mixing.pdf
 

Recently uploaded

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

Need a UMLL diagram for these 3 classes please i will like and comment.pdf

  • 1. Need a UMLL diagram for these 3 classes please i will like and comment public class OOP_Ass1 { public static void main(String[] args) { GameItem sword = new GameItem("Sword", 1, 10, 5, 0); GameItem magicStaff = new GameItem("Magic Staff", 2, 0, 10, 5); Character c1 = new Character("Omar",2231,12,15,44,sword); Character c2 = new Character("Ahmed",11441,30,40,1000,magicStaff); c1.Comparison(c2); System.out.println("Equal? "+c1.equals(c2)); System.out.println("Dublicate? "+c1.dublicate(c2)); Character c3 = new Character(c2); System.out.println("Copied: "+c3); System.out.println(""); sword.Comparison(magicStaff); System.out.println("Equal? " + sword.equals(magicStaff)); GameItem swordDuplicate = new GameItem("Sword", 50, 10, 55, 0); System.out.println("Duplicate? " + sword.isDuplicate(swordDuplicate)); GameItem swordCopy = sword.copy(); System.out.println("Copied: " + swordCopy); System.out.println("The expected winner is: "+c1.expectedWinner(c2)); } } ///////////////////////// 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) {
  • 2. 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
  • 3. 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 + '}'; } } ///////////////////////////////////////// public class Character { private String name; private int id; private int strength; private int speed; private int intelligence; private GameItem g; public Character(){ name = "0"; id = 0; strength = 0; speed = 0; intelligence = 0; } public GameItem getG() { return g; } public void setG(GameItem g) { this.g = g; } public String getName() { return name; }
  • 4. public void setName(String name) { this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getStrength() { return strength; } public int getTotalStrength(){ int total = strength + g.getStrengthModifier(); if (total > 100) return 100; return total; } public void setStrength(int strength) { if (strength <= 0) this.strength = 0; else if(strength >= 100) this.strength = 100; else this.strength = strength; } public int getSpeed() { return speed; } public int getTotalSpeed(){ int total = speed + g.getSpeedModifier(); if (total > 100) return 100;
  • 5. return total; } public void setSpeed(int speed) { if (speed <= 0) this.speed = 0; else if(speed >= 100) this.speed = 100; else this.speed = speed; } public int getIntelligence() { return intelligence; } public int getTotalIntelligence(){ int total = intelligence + g.getIntelligenceModifier(); if (total > 100) return 100; return total; } public void setIntelligence(int intelligence) { if (intelligence <= 0) this.intelligence = 0; else if(intelligence >= 100) this.intelligence = 100; else this.intelligence = intelligence; } public Character(String name, int id ,int i , int sp, int st,GameItem g){ this.setId(id); this.setName(name); this.setIntelligence(i); this.setSpeed(sp); this.setStrength(st); this.setG(g); } public boolean equals(Character c2){
  • 6. return this.getStrength() == c2.getStrength() && this.getSpeed() == c2.getSpeed() && this.getIntelligence() == c2.getIntelligence(); } public boolean dublicate(Character c2){ return (this.name.equalsIgnoreCase(c2.name) && this.id == c2.id && this.intelligence == c2.intelligence && this.speed == c2.speed && this.strength == c2.strength); } public void Comparison(Character c){ System.out.println("Character 1:tCharacter 2:"); System.out.println(this.getTotalStrength() + "t |t" + c.getTotalStrength()); System.out.println(this.getTotalSpeed() + "t |t" + c.getTotalSpeed()); System.out.println(this.getTotalIntelligence() + "t |t" + c.getTotalIntelligence()); } //Ask prof what is the gameitem public Character(Character c1){ this.name = c1.name; this.id = c1.id; this.intelligence = c1.intelligence; this.speed = c1.speed; this.strength = c1.strength; this.g = c1.g; } public Character expectedWinner(Character other) { double avgStats = (this.getTotalStrength() + this.getTotalSpeed() + this.getTotalIntelligence()) / 3.0; double otherAvgStats = (other.getTotalStrength() + other.getTotalSpeed() + other.getTotalIntelligence()) / 3.0; if (avgStats > otherAvgStats) return this; else return other;
  • 7. } @Override public String toString() { return "Character{" + "name=" + name + ", id=" + id + ", strength=" + strength + ", speed=" + speed + ", intelligence=" + intelligence + ", g=" + g + '}'; } } UML diagram please i will like and comment 3 CLASSES