Given main() and the Instrument class, define a derived class, StringInstrument, for string instruments.
Ex. If the input is:
Drums Zildjian 2015 2500 Guitar Gibson 2002 1200 6 19
the output is:
Instrument Information: Name: Drums Manufacturer: Zildjian Year built: 2015 Cost: 2500 Instrument Information: Name: Guitar Manufacturer: Gibson Year built: 2002 Cost: 1200 Number of strings: 6 Number of frets: 19

Answers

Answer 1

Answer:

Explanation:

The following derived class called StringInstrument extends the Instrument class and creates the necessary private variables for number of Strings and number of Frets. Then it creates getter and setter methods for each of the variables. This allows them to be called within the main method that has already been created and output the exact sample output as seen in the question.

class StringInstrument extends Instrument {

   private  int numStrings, numFrets;

   public int getNumOfStrings() {

       return numStrings;

   }

   public void setNumOfStrings(int numStrings) {

       this.numStrings = numStrings;

   }

   public int getNumOfFrets() {

       return numFrets;

   }

   public void setNumOfFrets(int numFrets) {

       this.numFrets = numFrets;

   }

}

Given Main() And The Instrument Class, Define A Derived Class, StringInstrument, For String Instruments.Ex.

Related Questions

Type the correct answer in the box. Spell all words correctly.

What type of network has cache servers that are connected to the original server?

A(n) ________ delivery network consists of cache servers that are connected to the original server.

Answers

Answer:

A Content Delivery Network (CDN) consists of cache servers that are connected to the original server.

Which element adjusts the space around the data in each cell of a table? adjusts the space around the data in each cell of a table.

Answers

Answer:

Increase/decrease indentation

Explanation:

Answer:

(Cellpadding) is actually the correct answer.

Explanation:

Cellpadding and cellspacing are two important features of an HTML table. Cellpadding sets the space around the data in each cell. Cellspacing sets the space around each cell in the table.

Which options are available when using a combo box rather than a list box? Check all that apply. A user can type in the values. A user can search for a record. The combo box can sort through records. A user can get values from another query. The combo box includes drop-down menus. A user can retrieve values from another table.

Answers

Answer:

A, B, D, F

Explanation:

Question 20
When looking to create video content for your marketing strategy, what three best practices
should you look to include?

Answers

Answer:

Short, technical, include a call to action.

Relevant, short, entertaining.

Short, entertaining, include a call to action.

Explanation:

Other Questions
Eli's parents open a savings account for when he was born in the account earns compound interest compounded annually how much money will be in Eli's account at age 21 Manuel incorrectly claimed that the surface area of the cylindershown is about 621.7 in.. Use a formula to find the surface area of the cylinder.Use 3.14 for it. What was his likely error?11 inThe surface area of the cylinder is about(Round to the nearest tenth as needed.) Geometry Question, please help! WORTH 20 POINTS You Try: Solve for x and y by using elimination. 4x + y = 7 4x - 2y = -2 Does anybody know all the parts? The fact that brown moths are easier to see and less likely to survive is known as 4/6: Who has more control over your life, the state government or the federal government? Why? How long does Jake give Dr. Sabato to tell them who he is and what he's doing? In DEF, the measure of F=90, FD = 3.3 feet, and DE = 3.9 feet. Find the measure of D to the nearest degree plz hurry plzz Motezuma II did not attack Cortes becausea.he was crazy.c.he believed Cortes was the Aztec god Quetzalcoatl.b.Cortes forces outnumbered the Aztecs.d.he considered making Cortes an ally to help him take over the Yucatan. Which expression is equivalent to `7+10x+x-3?` What is the most important information you need to receive a stock quote? For brainiest :):):):):):)):):):) Solve the question in the picture below. Thank you. Please help! Describe how the variables in the given equation are related.[tex]p=\frac{kqrt}{s}[/tex] brainly and points if you want Jeden z przedstawicieli polskiego renesansu. Autor dzie politycznych, w tym piciotomowego dziea O poprawie Rzeczypospolitej C'mon answer this and your cool Weird math question. What is the measure of angle C