Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In (JAVA) object oriented programming Write the necessary codes for the given UML class diagrams. In main method, create 2 objects; one from KibishiFighter and

image text in transcribedimage text in transcribed

In (JAVA) object oriented programming

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 isDead (boolean). While any Fighter is alive (isDead false), one should attack another, and its opponent should defense. Each attack method (attackTo, judo Attack To 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 Hybrid Fighter classes were not written. However, you can know them using parent-child (superclass-subclass) relationship given by UML. > > > Judo AttackBehaviours MuayThaiAttackBehaviour - BoxingAttackBehaviour -Fighter judo AttackTo(Fighter opponent) - Fighter muayThaiAttackTo(Fighter opponent) -Fighter boxingAttackTo(Fighter opponent) > Fighter #String name I sint health > > > +Fighter (int health, String name) --Fighter attackTo(Fighter opponent) -void defensel HybridFighter KibishiFighter + Hybrid Fighter (int health, String name) +KibishiFighter(int health, String name) OOPfinal02 + static String[] main(String[] args) 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, judoAttackTo 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 judoAttack To[Fighter opponent) -Fighter MuayThaiAttackTo(Fighter opponent) -Fighter boxingAttackTo(Fighter opponent) > > > +Fighter (int health. String name) -Fighter attackTo(Fighter opponent) -void defense 1 HybridFighter KibishiFighter +HybridFighter (int health, String name) * Kibishi Fighter(int health, String name) OOPfinal02 +static Stringll main(Stringil 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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

How to solve maths problems with examples

Answered: 1 week ago

Question

=+ How would you advise those problems be resolved?

Answered: 1 week ago