Question: Current file: Grok.java Load default template... 1 public class Grok private static final int DEFAULT_POWER_LEVEL-50; 4 /instance variables private int powerLevel; //accessor variables 10 *


Current file: Grok.java Load default template... 1 public class Grok private static final int DEFAULT_POWER_LEVEL-50; 4 /instance variables private int powerLevel; //accessor variables 10 * Initializes a Grok object to the default power level of 50 12 13 14 15 16 17 public GrokO) setPowerLevel(DEFAULT_POWER_LEVEL); 19 20 21 Initializes a Grok object to power powerLevel public Grok(int powerLevel) 23 24 25 26 27 28 29 30 31 32l //add your code here *Returns the power level of this Grok. *return returns the power level of this Grok public int getPowerLevelO //add your code here 34 35 36 37 38 39 40 41 42 //mutator methods * Sets the power level of this Grok. * eparam powerLevel the power value to set for this Grok public void setPowerLevel(int powerLevel) //add your code here 45 47 48 49 50 51 52 53 54 *Set the power level of this Grok to the power level of the pill *eparam pill The PowerPill that the this Grok. The powen of the pill is added to the power level of this Grok. public void takePowerPill(PowerPill pill) //add your code here 56 57 58 59 60 61 62 public void tookHitO 63 64 65 Invoked when this Grok takes a hit. The power level of *this Grok is reduced by 5 //add your code here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
