Question
Create a class Java class called Archer that has the following attributes: Archer Health - Integer Intelligence - Integer Dexterity - Integer Strength - Integer
Create a class Java class called Archer that has the following attributes:
Archer |
Health - Integer |
Intelligence - Integer |
Dexterity - Integer |
Strength - Integer |
Stamina - Integer |
Archer() |
Archer(Health, Intelligence, Dexterity, Strength, Stamina) |
getHealth() - Integer |
setHealth(Integer) - Void |
getIntelligence() - Integer |
setIntelligence(Integer) - Void |
getDexterity() - Integer |
setDexterity(Integer) - Void |
getStrength() - Integer |
setStrength(Integer) - Void |
getStamina() - Integer |
setStamina(Integer) - Void |
getDamagePerRangedAttack() - Double |
getDamagePerMeleeAttack() - Double |
toString() - String |
Notes:
All attributes should not be allowed to be set below 0.
The getDamagePerRangedAttack() method will return a double value. This value is a result of the math: (dexterity * 0.5 + intelligence * 0.8). You should not directly reference any attributes and should instead use the get methods for each attribute.
The getDamagePerMeleeAttack() method will return a double value. This value is a result of the math: (dexterity * 0.5 + strength * 0.8). You should not directly reference any attributes and should instead use the get methods for each attribute.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started