Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java language please Question 250pt]: Write the necessary codes for the given UML class diagrams. In main method, create 2 objects, one from KibishiFighter

image text in transcribed

in java language please

Question 250pt]: 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 Klbishi Fighter and HybridFighter classes were not written. However, you can know them using parent-child (superclass-subclass) relationship given by UML. > Judo AttackBehaviours MuayThaiAttackBehaviour BoxingAttackDohaviour -FighterudoAltack To Fighter opponent) -Fighter muayTha Altack To Fighter opponent) -Fighter boxing Altuck To Fighter opponent 4 ccabatracta Fighter 1 String name sint health 1 1 > e implements >> implements) +Fighter fint health, String name) -Fighter attack To Fighter opponent) -void defense) ! 1 HybridFighter KibishiFighter + HyoridFighter (int health, String name) + , +KibishiFighter(int health, String name) OOPli nalaz + static Stringli mainiStringil args) Verilen UML snf diyagramlar iin gerekli kodlar yazn. Main metodunda biri KibishiFighter dieri HybridFighter classndan 2 tane nesne oluturun. Main methodunda isDead (boolcan) adl deiken oluturun. Herhangi bir Fighter hayatta olduu srece (isDead false ), biri dierine saldrmal (attack) ve rakibi savurunaldr (defense). Her saldr methodu (attackTo, judoAttackTo vb.) rakip Fighterin saln azaltmaldr (miktarna siz karar verirsiniz). defense methodlar ise, sahibi olan Fighterin salm artr. Birisi oldoginde ikisinin health deerini yazdrin. KibishiFighter ve HybridFighter snflardaki methodlarnn UML de yazlmadn unutmayn. Ancak, bunlar UML de verilen ebeveyn-cocuk (st-alt smif) ilikisini kullanarak bilebilirsiniz

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago