Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Blackboard Collaborate Ultra-PX D Bb Collaborate - Weekly Lab Ses * + n.com/5d2d98210a855/76489367X-Blackboard-Expiration=1612526400000&X-Blackboard... el 2 / 2 75% Exercise 2: Based on the following UML

image text in transcribed

Blackboard Collaborate Ultra-PX D Bb Collaborate - Weekly Lab Ses * + n.com/5d2d98210a855/76489367X-Blackboard-Expiration=1612526400000&X-Blackboard... el 2 / 2 75% Exercise 2: Based on the following UML of GameChar class: Create the Java class GameChar. (default constructor set to: name as player" - 100 points - I points/hit - I hit/sec) Use a test program to create three objects of type GameChar: (MAIN CLASS) playerl: Kim - 200 points - 2 pointshit - 2 hit/sec player2: Tom - 300 points - 3 points/hit -0.5 hit/sec player3: no details (call default constructor) Update "player3" to: Ben - 150 points - 3 points/hit-4 hit/sec Design fightWinner method in the test program (MAIN) that takes two GameChar objects and print the name of the winning character. Hint: the winner is the character that need less time to end the fight. Time PlayerA-Number of hits / Speed - Math.ceil(lifePoints(PlayerB) / strength(Player)) / speed(PlayerA) Print the winning scenarios between playerl, player2 and player3 using fight Winner method. (Pl vs P2 Pl vs P3, and P2 vs P3). GameChar name: String - lifePoints: int -- strength: int - speed: double + GameChar() + GameChar (String int, int, double) + setName(String): void getName(): String + setLifePants(int): void + getLifePoints() int + setStrength(int): void + getStrength Cint setSpeed (double): void + getSpeed Of double +toStringo: String W Q F6 F7 F8 Home End F9 F10 F11 F12 & * 6 7 8 9 7 0 V IL

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

More Books

Students also viewed these Databases questions

Question

What is management growth? What are its factors

Answered: 1 week ago

Question

3. What are potential solutions?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago