Question: Can you please help me out with this JAVA Question? Directions and example You are once again working for a game development company on a

Can you please help me out with this JAVA Question?
 Can you please help me out with this JAVA Question? Directions
and example You are once again working for a game development company

Directions and example You are once again working for a game development company on a new project, but this time you are writing a subclass of the Shield class called MagicShield. As a reminder, the Shield class has the following fields and methods: private String name private int protection private boolean isDestroyed public Shield(String name) -constructor that initializes the Shield's name to the value passed in to the method and sets protection to 100 and isDestroyed to false public Shield(String name, int protection) - constructor that initializes the Shield's name and protection to the values passed in to the method and sets isDestroyed to false public void repairif isDestroyed is false, this method resets the protection level to 100; otherwise, it has no effect publie void defend (int amount) - decreases the Shield's protection by the amount; the lowest this value can be is zero(i.e. if the shield's protection is at 5 and it defends against 10 damage, then the new protection value should be 0, not -5). If the value hits zero, set isDestroyed to false. publie boolean isDestroyed otherwise - returns true if the Shield's isDestoryed value is true and false public String getName) returns the Shield's name public String toString) -displays the Shield's name and protection Your task is to implement a MagicShield class that extends Shield. A MagicShield has the ability to turn into a pizza, which the player can then eat to increase their health. This is particularly useful if the player is running away from a battle they are about to lose, and needs to restore their health quickly. The MagicShield class needs to have the following fields and methods, in addition to those it inherits from Shield: private int servings-the number of servings of pizza this shield can generate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!