C C how what ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagi a csc a CSCC CSCC Hom| G Hom | imago how ht
Posted: Thu May 05, 2022 1:30 pm
C C how what ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagi a csc a CSCC CSCC Hom| G Hom | imago how https://www.answers.com/homework-help/que ... ework-assi... 50 ← → C n answers Home Study tools My courses My books My folder Career Life Continue to post anyone except the professor. Please make sure to only implement what is asked for. You may not add any instance variables to any class, though you may create local variables inside of a method to accomplish its task. No other methods should be created other than the ones listed here. 19 questions remaining Step 1 Develop the following class My Textbook Solutions Class Instant access to step-by-step solutions for your textbooks Name: Instrument Access Modifier public Extends: Object + + Instance variables Add a Add a Add a Name: name textbook textbook textbook Access modifier private Data type: String Constructors Name: Instrument Access modifier: public Parameters: none (default constructor) Task makes a call to the default constructor of its parent class sets the value of the instance variable name to "No Name Yet" Non-static Methods Name: setName Access modifier: public Parameters: new Name (data type String) Return type: void Task: sets the value of the instance variable name to the value of new Name Name: getName Access modifier public Parameters: none Return type: String Name: getName Access modifier: public Parameters: none O Desktop (? 57°F F Type here to search D ⠀⠀ + Ca As - 0 X "a 9:30 AM N 5/2/2022
- ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + A 58 33 € ← → C n https://www.answers.com/homework-help/que ... ework-assi... answers Home Study tools My courses v My books My folder Career Life Name: getName Access modifier public Parameters: none Return type: String Name: getName Access modifier public Parameters: none Return type: String Task: return the value of the instance variable name Name: toString Access modifier: public Parameters: none am Return type: String Task: returns the concatenation of the String "Name: " and the value of the instance variable name Name: equals Access modifier public Parameters: otherObject (datatype Object) Return type: boolean Task: returns true if the otherObject passed is not null and is an Instrument and if the name instance variable of otherObject is equal to the name instance variable of the calling object otherwise retums false. Step 2 Develop the following class Class Name: Stringinstrument Access Modifier public Extends: Instrument Instance variables Name: numberOfStrings Access modifier: private Datatype: in (? 57°F D ⠀⠀ 9:30 AM As 5/2/2022 - L Type here to search O 7 Desktop Ca 0 X "O N
| - □N Varial Digit (Fall Fall N Stud New App Q ratem New Apparatemkimb CCX nagi a CSC CSC C CSCC Hom C Home C magia how a what ✪ ☆☆ € ← → C https://www.answers.com/homework-help/que ... ework-assi... answers Home Study tools ✓ My courses ✓ My books My folder Career Life Name: numberOfStrings Access modifier: private Data type: int Name: stringArray Access modifier private Data type: String[] Static variables Static variables Name: maximumNumberOfStrings Access modifier private Datatype in Initial Value: 4 Constructors Name: Stringlastrument Access modifier public Parameters: none (default constructor) Task: makes a call to the default constructor of its parent class sets the value of the instance variable numberOfStrings to 0 sets stringArray to refer to an array of Strings with the number of elements equal to the value of the static variable maximumNumberOfStrings Non-static Methods Name: addString Access modifier public Parameters: new String(data type String) Return type: void Task: if numberOfStrings is less than the length of stringArray then place the value of new String into the stringArray in the element whose index is equal to numberOfStrings and increase the value of numberOfStrings by 1 Name: getStrings Access modifier public Parameters: none Return type: String Task returns the concatenation of the name of each String O (?) 57°F # H Type here to search. a D Desktop + 8 9:31 AM 5/2/2022
- ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + 58 33 ← → C n https://www.answers.com/homework-help/que ... ework-assi... A answers Home Study tools ✓ My courses ✓ My books My folder Career Life then place the value of newString into the stringArray in the element whose index is equal to numberOfStrings and increase the value of numberOfStrings by 1 Name: getStrings Access modifier: public Parameters: none Return type: String Task: returns the concatenation of the name of each String located in the stringArray (Note: This can be accomplished by looping through the part of the stringArray that is filled with string names and concatenating each of these values into a single string) Name: toString Access modifier: public Parameters: none Retum type: String Task: returns the concatenation of the toString method of its parent class with the String "Strings: " and the String returned Name: increaseMaxinsumNumberOftrings Access modifier public Parameters: new MaximumNumberOfStrings (data type int) Return type: void Task: if the value of new MaximumNumberOfStrings is greater than the value of the static variable maximum NumberOfStrings then change the value of maximumNumberOfStrings to the value of new MaximumNumberOfStrings ? 57°F D ⠀⠀ 9:31 AM As 5/2/2022 F Name: getMaximumNumberOfStrings Access modifier public Parameters: none Return type; int Task: returns the value of the static variable maximumNumberOfStrings Step 3 Develop the following class Class Name: Guitar A Madilim makli Type here to search O 7 Desktop Ca X "O N
- ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + A 58 33 ← → C n https://www.answers.com/homework-help/que ... ework-assi... € answers Home Study tools My courses ✓ My books My folder Career Life Class Name: Guitar Access Modifier: public Extends: StringInstrument Instance variables Name: stringType Access modifier private Datatype: String Static variables Name: maximum NumberOfGuitarStrings Access modifier private Datatype: int Initial Value: 6 Constructors Name: Guitar Access modifier public Name: getName Access modifier public Parameters: none Return type: String Task: return the value of the instance variable name Name: toString Access modifier: public Parameters: none Return type: String Task: returns the concatenation of the String "Name: "and the value of the instance variable name Name: equals Access modifier: public Parameters: otherObject (datatype Object) Return type: boolean Task: returns true if the otherObject passed is not mull and is an Instrument and if the name instance variable of otherObject is equal to the name instance variable of the calling object otherwise returns false O 7 ? 57°F D ⠀⠀ F Type here to search Desktop Ca As 0 X "O 9:32 AM N 5/2/2022
ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + - ← → C n https://www.answers.com/homework-help/que ... ework-assi... A 58 33 answers Home Study tools ✓ My courses ✓ My books My folder Career Life Step 4 Develop a class with only a main method in it: public class Instrument Demo { public static void main(String[] args) { /* Inside of this main method do the following: Create a reference to an array of Instruments called instrumentArray and have it refer to an array of Instruments with 5 elements Create a reference to an Instrument called mySaxophone and have it refer to new object of the Instrument class Set the name of mySaxophone to "Saxophone" Create a reference to a StringInstrument called myViolin and have it refer to new object of the StringInstrument class Set the name of myViolin to "Violin" Add the "G" string to myViolin Add the "D" string to myViolin Add the "A" string to myViolin Add the g string to myViolin Make a call to the static method getMaximumNumberOfGuitarStrings on the Guitar class and save the return value into an int called guitarstrings Make a call to the static method increaseMaximumNumberOfStrings on the String Instrument class and pass the value of the local variable quitarStrings as an to this mothad myGuitar and have it refer to new object of the Guitar class Set the name of myGuitar to "Guitar" Add the "E" string to myGuitar Add the "A string to myGuitar O 7 ? 57°F D F Type here to search Desktop ⠀⠀ Ca As 0 9:32 AM 5/2/2022 X "O N
- N Varial Digit(Fall Fall N Stude| New Apparatem kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + ← → C n https://www.answers.com/homework-help/que ... ework-assi... A 58 33 answers Home Study tools My courses My books My folder Career Life the local variable quitarstrings as an bed myGuitar and have it refer to new object of the Quitar class Set the name of myGuitar to "Guitar" Add the "E string to myGuitar Add the "A" string to myGuitar Add the "D" string to myGuitar Add the "G" string to myGuitar Add the "B" string to myGuitar P Add the "E" string to my Guitar Set the stringType of myGuitar to nylon. Insert mySaxophone into the instrumentArray at index 0 Insert myViolin into the instrumentArray at index 1 Insert myGuitar into the instrumentArray at index 2 Create a reference to a Guitar called myGuitar2 and have it refer to new object of the Guitar class Set the name of myGuitar2 to "Guitar" Add the "E" string to myGuitar2 Add the "A" string to myGuitar2 Add the "D" string to myGuitar2 Add the "G" string to myGuitar2 Add the "B" string to myGuitar2 Add the "E" string to my Guitar2 Set the stringType of myGuitar2 to nylon Write an if statement that uses the equals method to confirm that myGuitar and myGuitar2 are equal, if they are display output "They are the same" Loop through the first three elements of the array and print the result of calling the tostring method on each element •/ } O ? 57°F F } Type here to search 7 Desktop D ⠀⠀ Ca 0 9:33 AM As 5/2/2022 X "O N
- ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + A 58 33 € ← → C n https://www.answers.com/homework-help/que ... ework-assi... answers Home Study tools My courses v My books My folder Career Life Name: getName Access modifier public Parameters: none Return type: String Name: getName Access modifier public Parameters: none Return type: String Task: return the value of the instance variable name Name: toString Access modifier: public Parameters: none am Return type: String Task: returns the concatenation of the String "Name: " and the value of the instance variable name Name: equals Access modifier public Parameters: otherObject (datatype Object) Return type: boolean Task: returns true if the otherObject passed is not null and is an Instrument and if the name instance variable of otherObject is equal to the name instance variable of the calling object otherwise retums false. Step 2 Develop the following class Class Name: Stringinstrument Access Modifier public Extends: Instrument Instance variables Name: numberOfStrings Access modifier: private Datatype: in (? 57°F D ⠀⠀ 9:30 AM As 5/2/2022 - L Type here to search O 7 Desktop Ca 0 X "O N
| - □N Varial Digit (Fall Fall N Stud New App Q ratem New Apparatemkimb CCX nagi a CSC CSC C CSCC Hom C Home C magia how a what ✪ ☆☆ € ← → C https://www.answers.com/homework-help/que ... ework-assi... answers Home Study tools ✓ My courses ✓ My books My folder Career Life Name: numberOfStrings Access modifier: private Data type: int Name: stringArray Access modifier private Data type: String[] Static variables Static variables Name: maximumNumberOfStrings Access modifier private Datatype in Initial Value: 4 Constructors Name: Stringlastrument Access modifier public Parameters: none (default constructor) Task: makes a call to the default constructor of its parent class sets the value of the instance variable numberOfStrings to 0 sets stringArray to refer to an array of Strings with the number of elements equal to the value of the static variable maximumNumberOfStrings Non-static Methods Name: addString Access modifier public Parameters: new String(data type String) Return type: void Task: if numberOfStrings is less than the length of stringArray then place the value of new String into the stringArray in the element whose index is equal to numberOfStrings and increase the value of numberOfStrings by 1 Name: getStrings Access modifier public Parameters: none Return type: String Task returns the concatenation of the name of each String O (?) 57°F # H Type here to search. a D Desktop + 8 9:31 AM 5/2/2022
- ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + 58 33 ← → C n https://www.answers.com/homework-help/que ... ework-assi... A answers Home Study tools ✓ My courses ✓ My books My folder Career Life then place the value of newString into the stringArray in the element whose index is equal to numberOfStrings and increase the value of numberOfStrings by 1 Name: getStrings Access modifier: public Parameters: none Return type: String Task: returns the concatenation of the name of each String located in the stringArray (Note: This can be accomplished by looping through the part of the stringArray that is filled with string names and concatenating each of these values into a single string) Name: toString Access modifier: public Parameters: none Retum type: String Task: returns the concatenation of the toString method of its parent class with the String "Strings: " and the String returned Name: increaseMaxinsumNumberOftrings Access modifier public Parameters: new MaximumNumberOfStrings (data type int) Return type: void Task: if the value of new MaximumNumberOfStrings is greater than the value of the static variable maximum NumberOfStrings then change the value of maximumNumberOfStrings to the value of new MaximumNumberOfStrings ? 57°F D ⠀⠀ 9:31 AM As 5/2/2022 F Name: getMaximumNumberOfStrings Access modifier public Parameters: none Return type; int Task: returns the value of the static variable maximumNumberOfStrings Step 3 Develop the following class Class Name: Guitar A Madilim makli Type here to search O 7 Desktop Ca X "O N
- ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + A 58 33 ← → C n https://www.answers.com/homework-help/que ... ework-assi... € answers Home Study tools My courses ✓ My books My folder Career Life Class Name: Guitar Access Modifier: public Extends: StringInstrument Instance variables Name: stringType Access modifier private Datatype: String Static variables Name: maximum NumberOfGuitarStrings Access modifier private Datatype: int Initial Value: 6 Constructors Name: Guitar Access modifier public Name: getName Access modifier public Parameters: none Return type: String Task: return the value of the instance variable name Name: toString Access modifier: public Parameters: none Return type: String Task: returns the concatenation of the String "Name: "and the value of the instance variable name Name: equals Access modifier: public Parameters: otherObject (datatype Object) Return type: boolean Task: returns true if the otherObject passed is not mull and is an Instrument and if the name instance variable of otherObject is equal to the name instance variable of the calling object otherwise returns false O 7 ? 57°F D ⠀⠀ F Type here to search Desktop Ca As 0 X "O 9:32 AM N 5/2/2022
ON Varial Digi (Fall Fall N Stude| New Apparater kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + - ← → C n https://www.answers.com/homework-help/que ... ework-assi... A 58 33 answers Home Study tools ✓ My courses ✓ My books My folder Career Life Step 4 Develop a class with only a main method in it: public class Instrument Demo { public static void main(String[] args) { /* Inside of this main method do the following: Create a reference to an array of Instruments called instrumentArray and have it refer to an array of Instruments with 5 elements Create a reference to an Instrument called mySaxophone and have it refer to new object of the Instrument class Set the name of mySaxophone to "Saxophone" Create a reference to a StringInstrument called myViolin and have it refer to new object of the StringInstrument class Set the name of myViolin to "Violin" Add the "G" string to myViolin Add the "D" string to myViolin Add the "A" string to myViolin Add the g string to myViolin Make a call to the static method getMaximumNumberOfGuitarStrings on the Guitar class and save the return value into an int called guitarstrings Make a call to the static method increaseMaximumNumberOfStrings on the String Instrument class and pass the value of the local variable quitarStrings as an to this mothad myGuitar and have it refer to new object of the Guitar class Set the name of myGuitar to "Guitar" Add the "E" string to myGuitar Add the "A string to myGuitar O 7 ? 57°F D F Type here to search Desktop ⠀⠀ Ca As 0 9:32 AM 5/2/2022 X "O N
- N Varial Digit(Fall Fall N Stude| New Apparatem kimb C (x nagia csc a CSC CCSC G Hom C Hom C imaghow a what + ← → C n https://www.answers.com/homework-help/que ... ework-assi... A 58 33 answers Home Study tools My courses My books My folder Career Life the local variable quitarstrings as an bed myGuitar and have it refer to new object of the Quitar class Set the name of myGuitar to "Guitar" Add the "E string to myGuitar Add the "A" string to myGuitar Add the "D" string to myGuitar Add the "G" string to myGuitar Add the "B" string to myGuitar P Add the "E" string to my Guitar Set the stringType of myGuitar to nylon. Insert mySaxophone into the instrumentArray at index 0 Insert myViolin into the instrumentArray at index 1 Insert myGuitar into the instrumentArray at index 2 Create a reference to a Guitar called myGuitar2 and have it refer to new object of the Guitar class Set the name of myGuitar2 to "Guitar" Add the "E" string to myGuitar2 Add the "A" string to myGuitar2 Add the "D" string to myGuitar2 Add the "G" string to myGuitar2 Add the "B" string to myGuitar2 Add the "E" string to my Guitar2 Set the stringType of myGuitar2 to nylon Write an if statement that uses the equals method to confirm that myGuitar and myGuitar2 are equal, if they are display output "They are the same" Loop through the first three elements of the array and print the result of calling the tostring method on each element •/ } O ? 57°F F } Type here to search 7 Desktop D ⠀⠀ Ca 0 9:33 AM As 5/2/2022 X "O N