I am having issues with this, this project is due tonight. This is make or break, after making 5 different programs Im not getting this down. What I have now is...
class GuitarString { private boolean isPlaying; private int tunedValue; private String name; /* declear the note sound variables here */ public void GuitarString(){ this.isPlaying = false; this.tunedValue = 0; this.name = ""; /* initalize the note here */ } public void GuitarString(String name){ this.isPlaying = false; this.tunedValue = 0; this.name = name; /* initalize the note here */ } public void GuitarString(String name, int tunedValue){ this.isPlaying = false; this.tunedValue = tunedValue; this.name = name; /* initalize the note here */ } //Could make another for a custom note public boolean getisPlaying(){ return this.isPlaying; } public void setisPlaying(boolean isPlaying){ this.isPlaying = isPlaying; } public int getTunedValue(){ return this.tunedValue; } public void setTunedValue(int tunedValue){ this.tunedValue = tunedValue; } public String getname(){ return this.name; } public void setName(String name){ this.name= name; } // Then add in methods to make the string functional. public void playNote(){ setisPlaying(true); /* do playing sound stuff and set tuned value here */ setisPlaying(true); } public static void main(String[] args) { GuitarString GuitarStrings[] = new GuitarString[6]; GuitarStrings[0] = new GuitarString("E"); GuitarStrings[1] = new GuitarString("A"); GuitarStrings[2] = new GuitarString("D"); GuitarStrings[3] = new GuitarString("G"); GuitarStrings[4] = new GuitarString("B"); GuitarStrings[5] = new GuitarString("E"); } }
If you want my other 5 let me know and I will post them, what do I do next. =\