مســــــــاء الخيــــــر
انا مطلوب مني برنامج بخصوص object -oriented prohramming with java
واتمنى المســــــاعدة
In writing the code of the below methods you can use the Frog methods in table1
Message Frog
left() Move one stone to the left.
right() Move one stone to the right
home() Move to position 1
jump() Jump up and return to its position
setPosition(int) Set position attribute to argument value.
setColour(OUColour) Set colour attribute to argument value
i) Assume an interface called Dancer is defined as follows:
public interface Dancer
{
public void danceSteps(int n);
}
Write a class called DancerFrog that inherits Frog class and implements Dancer interface
The DancerFrog class has no attributes but it has the following members
A DancerFrog constructor that invokes parent constructor for initialization.
getReady(): is a helper method that takes no argument and returns no values. In this method the DancerFrog instance should be in red colour and should stand on position
Note that: a helper method is a private method not public.
danceSteps(int n): the DancerFrog instance should invoke getReady(). Then the following steps should be repeated number of times according to argument n: move right twice, jump, and finally move left
home(): the DancerFrog instance override the inherited method home() such that in addition to return back frog to position 1, it returns back its colour to green

