Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CIS2542 - Homework 03 Gorg vs Booy Battle - Part 2 - Bring on the Gorg! NOTE: Remember that you are adding on to your
CIS2542 - Homework 03 Gorg vs Booy Battle - Part 2 - Bring on the Gorg! NOTE: Remember that you are adding on to your previous Booy project. See the previous documentation for Booy specific information. The Gorg can no longer be reasoned with! Negotiations cannot go well if you have no idea what the other side wants! They are so strong and vicious that ignoring them only means Earth is indirectly conquered somehow? It's not my movie plot, but my retelling is totally butchering it for sure. The Booy are friends of all peoples across the galaxy. Or so we are told. These beloved creatures want nothing more than peace and harmony, as long as it is their version of peace and harmony. It turns out okay for everyone in the end I suppose. Maybe you can tell from the descriptions, but the Booy are quite the underdogs here! Captain Smek will need to simulate a Gorg battle many times over to see what their odds of victory would be. For the next part of this simulation, let's create the Gorg class. Here are their specifications. Gorg Every one of them is named George Every one of them has 10 health points When a Gorg gets attacked: o 1/4 of the time randomly, the attack will miss and do no damage o 1/4 of the time the Gorg will actually regain 1 health point! Just make sure the new health value doesn't get above the starting value of 10 o 1/2 of the time randomly, the attack will hit them and do [2-4] random damage Requirements 1) Create a Gorg class type Private string member variable for name Private int member variable for health Public constructor which initializes both member variables Public get function for the name Public get function for the health value Public boolean function called IsDefeated() O A Gorg is defeated when health
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started