I'm attempting to generalize my code through methods, however since I'm a newly introduced programmer, I need help.
Here is my code I'm trying to generalize:
I'm trying to generalize the code by putting it into this method:
What values would I have to put within the ( ) of this new keyPlacement method in order for this to work?
/**
* A piano that can be played with the computer keyboard.
*
*
* @version: 0.1
*/
public class Piano extends World
{
/**
* Make the piano.
*/
public Piano()
{
super(800, 340, 1);
Key key1 = new Key("C", "2c.wav");
addObject(key1, 50, getHeight()/2);
Key key2 = new Key("D", "2d.wav");
addObject(key2, 115, getHeight()/2);
Key key3 = new Key("A", "2d.wav");
addObject(key3, 180, getHeight()/2);
Key key4 = new Key("B", "2b.wav");
addObject(key4, 245, getHeight()/2);
}public void keyPlacement()
{
}
}

