Question: Question 2 [50pt]: Write the necessary codes for the given UML class diagrams. In main method, create 2 objects; one from KibishiFighter and one from

 Question 2 [50pt]: Write the necessary codes for the given UML

Question 2 [50pt]: Write the necessary codes for the given UML class diagrams. In main method, create 2 objects; one from KibishiFighter and one from HybridFighter classes, and create variable called is Dead (boolean). While any Fighter is alive (isDead false), one should attack another, and its opponent should defense. Each attack method (attackTo, judo AttackTo etc.) should decrease you decide amount) the health of opponent Fighters. Defense methods increase belonging fighter's health. Print out their health when one is dead. Note that methods in KibishiFighter and HybridFighter classes were not written. However, you can know them using parent-child (superclass-subclass) relationship given by UML. > > > - JudoAttackBehaviours - Muay ThaiAttackBehaviour - BoxingAttackBehaviour -Fighter judo AttackTo(Fighter opponent) -Fighter muayThaiAttackTo(Fighter opponent) -Fighter boxingAttackTo(Fighter opponent) 4 A > Fighter 1 #String name #int health > > > +Fighter (int health, String name) -Fighter attackTo(Fighter opponent) -void defense 1 N 1 1 1 IS IS HybridFighter KibishiFighter + HybridFighter (int health, String name) +KibishiFighter(int health, String name) LOOP final02 +static String[] main(String[] args)

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 Databases Questions!