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
Get step-by-step solutions from verified subject matter experts
