subject

In this exercise, you are going to build a hierarchy to create instrument objects. We are going to create part of the orchestra using three classes, Instrument, Wind, and Strings. Note that the Strings class has a name very close to the String class, so be careful with your naming convention! We need to save the following characteristics: Name and family should be saved for all instruments We need to specify whether a strings instrument uses a bow We need to specify whether a wind instrument uses a reed Build the classes out with getters and setters for all classes. Only the superclass needs a toString and the toString should print like this: Violin is a member of the Strings family. Your constructors should be set up to match the objects created in the InstrumentTester class. These are the files given
public class InstrumentTester
{
public static void main(String[] args)
{
/**
* Don't Change This Tester Class!
*
* When you are finished, this should run without error.
*/
Wind tuba = new Wind("Tuba", "Brass", false);
Wind clarinet = new Wind("Clarinet", "Woodwind", true);
Strings violin = new Strings("Violin", true);
Strings harp = new Strings("Harp", false);
System. out. println(tuba);
System. out. println(clarinet);
System. out. println(violin);
System. out. println(harp);
}
}

public class Wind extends Instrument
{
}

public class Strings extends Instrument
{
}

public class Instrument
{
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:30, cdavis379
: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
image
Computers and Technology, 23.06.2019 09:30, kreshnikolloma
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
image
Computers and Technology, 24.06.2019 02:20, Jonny13Diaz
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
image
Computers and Technology, 24.06.2019 12:50, opgbadwolf5
When is it most apprpriate for a development team to change the definition of done
Answers: 1
You know the right answer?
In this exercise, you are going to build a hierarchy to create instrument objects. We are going to c...

Questions in other subjects:

Konu
Mathematics, 04.02.2021 20:40
Konu
Mathematics, 04.02.2021 20:40