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 15:10
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
You know the right answer?
1 / 8 Step 1 Develop the following class: Class Name: Musician Access Modifier: public Instance vari...
Questions
question
Mathematics, 20.12.2019 19:31
question
Mathematics, 20.12.2019 19:31
question
Social Studies, 20.12.2019 19:31
Questions on the website: 13722361