Answered Essay: The program needed should be using JAVA and it shold compile a list of instruments from different instrument families. A family o

The program needed should be using JAVA and it shold compile a list of instruments from different instrument families. A family of musical Instruments is a grouping of several different but related sizes or types of instruments. Please comment some families are:

Brass Family – A brass instrument is a musical instrument that produces sound by sympathetic vibration of air in a tubular resonator in sympathy with the vibration of the player’s lips.
Ref:https://en.wikipedia.org/wiki/Brass_instrument (Links to an external site.)Links to an external site.

Strings Family – String instruments, stringed instruments, or chordophones are musical instruments that produce sound from vibrating strings.
Ref:https://en.wikipedia.org/wiki/String_instrument (Links to an external site.)Links to an external site.

Woodwind Family – Woodwind instruments are a family of musical instruments within the more general category of wind instruments. There are two main types of woodwind instruments: flutes and reed instruments (otherwise called reed pipes). What differentiates these instruments from other wind instruments is the way in which they produce their sound.
Ref:https://en.wikipedia.org/wiki/Woodwind_instrument (Links to an external site.)Links to an external site.

Percussion Family – A percussion instrument is a musical instrument that is sounded by being struck or scraped by a beater (including attached or enclosed beaters or rattles); struck, scraped or rubbed by hand; or struck against another similar instrument.
Ref:https://en.wikipedia.org/wiki/Percussion_instrument (Links to an external site.)Links to an external site.

Constraints

Limit the number of families to the list above

Use one separate (external to the main class) abstract superclass: Instrument

Use three separate (external to the main class) abstract subclasses that extend Instrument:

BlownInstrument
Fingered
Struck

Use four separate (external to the main class) subclasses (families) that extend the appropriate three above:

Brass
Strings
Woodwind
Percussion

Requirements

Display the menu shown in the downloadable PDF example

Request the number of instruments to be entered

All instruments should be placed into an array (you can use one array per family or one array for all entered) so they may be displayed

Use set and get methods where appropriate

Implement a loop that will allow the user to enter more instruments

Use exception handling and validation where appropriate

Expected Output—User input is in ​​BOLD

Select one of the following instrument families:

1. Brass

2. String

3. Woodwind

4. Percussion

5. Display all instruments

6. Exit

->: 1

How many brass instruments would you like to enter? ->: 3

Enter instrument #2->: bugle

Enter instrument #2->: trumpet

Enter instrument #3->: tuba

Display instruments? (Y for Yes, N for No)->: n

Enter more instruments? (Y for Yes, N for No)->: y

1. Brass

2. String

3. Woodwind

4. Percussion

5. Display all instruments

6. Exit

->: 2

How many string instruments would you like to enter? ->: 2

Enter instrument #1->: guitar

Enter instrument #2->: harp

Display instruments? (Y for Yes, N for No)->: n

Enter more instruments? (Y for Yes, N for No)->: y

1. Brass

2. String

3. Woodwind

4. Percussion

5. Display all instruments

6. Exit

->: 3

How many wood wind instruments would you like to enter? ->: 2

Enter instrument #1->: clarinet

Enter instrument #2->: oboe

Display instruments? (Y for Yes, N for No)->: n

Enter more instruments?

Expert Answer

 

File Name: Instrument.java

public abstract class Instrument {

}

File Name: BlownInstrument.java

public abstract class BlownInstrument extends Instrument {

}

File Name: Fingered.java

public abstract class Fingered extends Instrument {

}

File Name: Struck.java

public abstract class Struck extends Instrument {

}

File Name: Brass.java

public class Brass extends BlownInstrument {

}

File Name: Strings.java

public class Strings extends Fingered {

}

File Name: Woodwind.java

public class Woodwind extends BlownInstrument {

}

File Name: Percussion.java

public class Percussion extends Fingered {

}

File Name: DemoInstruments.java

public class DemoInstruments {

int numberBrass, numberStrings, numberWoodWind, numberPercussion;

public void static void main(String args[]) {

int choice = 0;

String[] brassFamily;

String[] stringsFamily;

String[] woodwindFamily;

String[] percussionFamily;

int number;

String family;

DemoInstruments demoInstruments = new DemoInstruments();

Scanner scan = new Scanner(new DataInputStream(System.in));

System.out.println(“Select one of the following instrument families”);

do {

System.out.print(“1. Brassn2. Stringn3 Woodwindn4. Percussionn5. Display all instrumentsn6. Exitn->: “);

choice = scan.nextInt();

switch(choice) {

case 1:

System.out.println(“How many Brass instruments would you like to enter? ->”);

numberBrass = scan.nextInt();

brassFamily = demoInstruments.addInstruments(brassFamily, scan, numberBrass);

break;

case 2:

System.out.println(“How many String instruments would you like to enter? ->”);

numberStrings = scan.nextInt();

stringsFamily = demoInstruments.addInstruments(stringsFamily, scan, numberStrings);

break;

case 3:

System.out.println(“How many Woodwind instruments would you like to enter? ->”);

numberWoodWind = scan.nextInt();

woodwindFamily = demoInstruments.addInstruments(woodwindFamily, scan, numberWoodWind);

break;

case 4:

System.out.println(“How many Percussion instruments would you like to enter? ->”);

numberPercussion = scan.nextInt();

percussionFamily = demoInstruments.addInstruments(percussionFamily, scan, numberPercussion);

break;

case 5:

if(numberBrass != 0) {

System.out.println(“Brass Family”);

for(int i=0; i<numberBrass; i++)

System.out.println(brassFamily[i]);

}

if(numberStrings != 0) {

System.out.println(“Strings Family”);

for(int i=0; i<numberStrings; i++)

System.out.println(stringsFamily[i]);

}

if(numberWoodWind != 0) {

System.out.println(“Woodwind Family”);

for(int i=0; i<numberWoodWind; i++)

System.out.println(woodwindFamily[i]);

}

if(numberPercussion != 0) {

System.out.println(“Percussion Family”);

for(int i=0; i<numberPercussion; i++)

System.out.println(percussionFamily[i]);

}

break;

case 6:

break;

}

}while(choice != 6);

}

public String[] addInstruments(String[] instruments, Scanner scan, number) {

intruments[] = new String[number];

for(int i=1; i<=number; i++) {

System.out.print(“Enter instrument #” + i + “->:”);

instruments[i-1] = scan.next();

}

return instruments;

}

}

Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.

× How can I help you?