Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

Using the answer to Prob 11, try to sketch some isotherms.

Answered: 1 week ago

Question

1+1

Answered: 1 week ago

Question

KEY QUESTION Refer to Figure 3.6, page

Answered: 1 week ago