subject

1 / 8 Step 1 Develop the following class: Class Name: Musician Access Modifier: public Instance variables Name: name Access modifier:private Data type: String Name: instrumentArray Access modifier:private Data type: String ) Name: numberOfInstruments Access modifier:private Data type: int Constructors Name: Musician Access modifier: public Parameters: none (default constructor) Task: sets the value of the instance variable name to the empty string sets the instrumentArray to refer to an array of Strings with number of elements equal to 10 sets the value of the instance variable numberOfInstruments to 0 Methods Name: setName Access modifier: public Parameters: name (data type String) Return type: void Task: sets the value of the instance variable this name to the value of the name parameter Name: getName Access modifier: public Parameters: none Return type: String Task: return the value of the instance variable name Name: addinstrument Access modifier: public Parameters: newinstrument (data type String) Return type: void Task: if numberOfInstruments is less than the length of instrumentArray then place the value of newInstrument into the instrumentArray in the element whose index is equal to numberOfinstruments and increase the value of numberOfInstruments by 1 Name: getInstruments Access modifier: public Parameters: none Return type: String Task: returns the concatenation of the name of each instrument located in the instrumentArray (Note: This can be accomplished by looping through the part of the instrumentArray that is filled with instruments and concatenating each of these values into a single string) Name: getNumberOfInstruments Access modifier: public Parameters: none Return type: int Task: returns the value of the instance variable numberOfInstruments Name: toString Access modifier: public Parameters: none Return type: String Task returns the concatenation of the String "Name:"and the value of instance variable name and the String "plays" and the value of the instance variable numberOfInstruments and the String "instruments which are" and the String returned by a call to the getInstruments method Name: equals Access modifier: public Parameters: otherObject (datatype Object) Return type: boolean Task returns true if the otherObject passed is not null and is a Musician and if the name instance variable of otherObject is equal to the name instance variable of the calling object and if the String returned by a call to the getinstruments method of otherObject is equal to the String returned by a call to the getinstruments method of the calling object and if the numberOfInstruments instance variable of otherObject is equal to the number ofinstruments instance variable of the calling object; otherwise return false

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:30
Identify at least three types of characteristics that you were asked about as you the computer identify a fruit.
Answers: 3
question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
You know the right answer?
1 / 8 Step 1 Develop the following class: Class Name: Musician Access Modifier: public Instance vari...
Questions
Questions on the website: 13722367