Skip to main content

3 out of 3. I am inclined to give this because your solution implements the spec described. However, the set Position method for this class written in part (iii) carries out the specified functionality (and itself contains a test for the position value being in the range 1 to 11 before calling the Frog class's constructor, so it is redundant to do the test again in this method). Also, although the set height method for this class written in part (iv) only checks for the height attribute being > 0, the height of a restricted hover frog can never go above 6, so again the set Height method for this class written in part (iv) meets the specified functionally, and therefore the test is actually unnecessary. So one could simplify the code to Constructor for objects of class Restricted Hover Frog which initialises height to the argument a Position and height to the argument a Height. public Restricted Hover Frog in to a Position, in to a Height super this set Position a Position this set Height a Height. Note: I have simplified the comment because I think that is the effect of what the Question is actually specifying!