Question: ( JAVA CODE ) Create a class Weapon ( member variables name, power, ability, type: { spell , explosive, staff, cudgel, throwing - device }

(JAVA CODE)
Create a class Weapon (member variables name, power, ability, type: {spell, explosive, staff, cudgel, throwing-device})
Create an abstract class Monster (member variables: name, habitat, health, ArrayList) with subclasses Ogre (member variable hasScales) and Troll (member variable height)
Create an abstract class Hero (member variables name, strength, health, ArrayList) with subclasses Mage (member variable age), Faerie (member variable height) and Warrior (member variable hasTransport)
Create an interface Armable that has the String method wieldWeapon([insert what you need here])[=optional].
Faeries are not Armable, so while they can collect any weapons, they cannot use them.
Mages can collect any weapon but can only use spells as weapons
Implement Comparable for Heros - compare created heroes based on strength.
When creating Heroes, throw an appropriate exception if strength <1
When creating Mages throw an appropriate exception if age <1
Create a JavaFX form (or forms) to create instances of each type of Monster & Hero, allow them to collect different kinds of Weapons, compare your Heros once created.
Write the instances of each class that is created out to a text file ("yourname.txt")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!