Question & Answer: 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.

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: The program needed should be using JAVA and it shold compile a list of instruments from different instrument families. A family o…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

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;

}

}

Grand Paper Writers
Order NOW For A 10% Discount!
Pages (550 words)
Approximate price: -

Our Advantages

Plagiarism Free Papers

All papers are written by the best professional writers to ensure 100% originality. We always provide plagiarism reports whenever we deliver completed papers.

Free Revisions

All papers by Grand Paper Writers are completed and submitted on time. This timely delivery of papers gives you time to go through the paper before the official deadline.

Title-page

As an additional service, we will provide a title page that precedes the contents of your paper. Here, you will provide your personal details.

Bibliography

We also ensure that we provide an extra page for the references or bibliographies following referencing rules.

Originality & Security

At Grandpaperwriters.com, we guarantee students for the provision of security and original work. All your personal information is handled with confidentiality and is not shared with third parties. Additionally, we ensure that we provide original content with accompanying plagiarism reports to show originality.

24/7 Customer Support

Our customer support team is always available 24/7 to provide instant responses to any queries raised by students.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
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.

Our Services

Grandpaperwriters.com has the best professional essay writers for quality services.

Pricing

Flexible Pricing

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Communication

Admission Help & Client-Writer Contact

Grandpaperwriters.com provides an interactive portal where students can communicate directly to their writers.

Deadlines

Paper Submission

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Reviews

Customer Feedback

Grandpaperwriters.com appreciates feedback from our clients to help us improve the delivery of essay writing services. As such, we are constantly changing our policies to ensure maximum customer and writer satisfaction.