Answered Essay: I need your help on this weeks Java programming task. Below is the task for this week can you please help me with th

I need your help on this weeks Java programming task. Below is the task for this week can you please help me with this? I have one more task afte this one, and I’ll be finaly done with all my task.. The book for the class is Introduction to Java Programming, Comprehensive Version Y. Daniel Liang & Prentice Hall 11th Edition / 2018. We are currently working in Chapter 13. but this task covers all learned from week 1 through week 13. I would like to thank everyone that works for Chegg, if it were not for you guys I would not have passed this class. Thank you

Task for this week Write a program that will 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. Ref: https://en.wikipedia.org/wiki/Family_(musical_instruments) Some commonly recognized families are:

Brass Family – A brass instrument is a musical instrument that produces sound by sympatheticvibration of air in a tubular resonator in sympathy with the vibration of the player’s lips.

Ref: https://en.wikipedia.org/wiki/Brass_instrument

Strings Family – String instruments, stringed instruments, or chordophones are musicalinstruments that produce sound from vibrating strings.

Ref: https://en.wikipedia.org/wiki/String_instrument

Woodwind Family – Woodwind instruments are a family of musical instruments within the moregeneral category of wind instruments. There are two main types of woodwind instruments:flutes and reed instruments (otherwise called reed pipes). What differentiates theseinstruments from other wind instruments is the way in which they produce their sound.

Ref: https://en.wikipedia.org/wiki/Woodwind_instrument

Percussion Family – A percussion instrument is a musical instrument that is sounded by beingstruck or scraped by a beater (including attached or enclosed beaters or rattles); struck, scrapedor rubbed by hand; or struck against another similar instrument.

Ref: https://en.wikipedia.org/wiki/Percussion_instrument

Constraints

Limit the number of families to the list aboveUse one separate (external to the main class) abstractsuper class: InstrumentUse three separate (external to the main class) abstract subclasses that extend Instrument:oBlownInstrumentoFingeredoStruckUse four separate (external to the main class) subclasses (families) that extend the appropriate three aboveoBrassoStringsoWoodwindoPercussion

Requirements

Display the menu shown in the example output below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This assignment will use coding principles learned from week 1 through 13

Hints

Make sure you use Java coding conventions

Expected Output

Below is a sample run where instruments are entered for each family. 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 #1->: 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?

(Y for Yes, N for No)->: y

1.Brass

2.String

3.Woodwind

4.Percussion

5.Display all instruments

6.Exit

->: 4

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

Enter instrument #1->: drum

Enter instrument #2->: marimba

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

->: 5

The bugle is a brass instrument and is played by mouth.

The trumpet is a brass instrument and is played by mouth.

The tuba is a brass instrument and is played by mouth.

The clarinet is a woodwind instrument and is played by mouth.

The oboe is a woodwind instrument and is played by mouth.

The guitar is a string instrument and is played with fingers.

The harp is a string instrument and is played with fingers.

The drum is a percussion instrument and is struck.

The marimba is a percussion instrument and is struck.

Enter more instruments?

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

Goodbye

Expert Answer

 

package display_music_array;

import java.util.Scanner;

public class Display_music_array {

public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int ch=0,n1=0,n2=0,n3=0,n4=0;
char c;

String b[] = new String[50];
String s[] = new String[50];
String w[] = new String[50];
String p[] = new String[50];
// accepts the user choice and perform the operation until exit
do{
// display the menu
System.out.println(“Select one of the musicial families :”);
System.out.println(“1.Brassn” +”2.Stringn” +”3.Woodwindn” +”4.Percussionn” +”5.Display all instrumentsn” +”6.Exit”);
System .out.println(“Enter your choice ->”);
ch = in.nextInt();
switch(ch){
case 1:
System.out.println(“How many brass instruments would you like to enter -> “);
try{
n1=in.nextInt();
b = get_Instrument(n1);
System.out.println(“Display instruments?n” +”(Y for Yes, N for No)-> :”);
c = in.next().charAt(0);
if (c == ‘y’ || c == ‘Y’)
disp_ins(“brass”,”mouth”,b,n1);
}
catch(Exception e)
{
System.out.print(e);
}
break;
case 2:
try{
System.out.println(“How many String instruments would you like to enter -> “);
n2=in.nextInt();
s = get_Instrument(n2);
System.out.println(“Display instruments?n” +”(Y for Yes, N for No)-> :”);
c = in.next().charAt(0);
if (c == ‘y’ || c == ‘Y’)
disp_ins(“String”,”fingers”,s,n2);
}
catch(Exception e)
{
System.out.print(e);
}
break;
case 3:
try{
System.out.println(“How many Woodwind instruments would you like to enter -> “);
n3=in.nextInt();
w = get_Instrument(n3);
System.out.println(“Display instruments?n” +”(Y for Yes, N for No)-> :”);
c = in.next().charAt(0);
if (c == ‘y’ || c == ‘Y’)
disp_ins(“WoodWind”,”mouth”,w,n3);
}
catch(Exception e)
{
System.out.print(e);
}
break;
case 4:
try{
System.out.println(“How many Percussion instruments would you like to enter -> “);
n4=in.nextInt();
p = get_Instrument(n4);
System.out.println(“Display instruments?n” +”(Y for Yes, N for No)-> :”);
c = in.next().charAt(0);
if (c == ‘y’ || c == ‘Y’)
disp_ins(“Percussion”,”struck”,p,n4);
}
catch(Exception e)
{
System.out.print(e);
}
break;
case 5:
disp_ins(“brass”,”mouth”,b,n1);
disp_ins(“String”,”fingers”,s,n2);
disp_ins(“WoodWind”,”mouth”,w,n3);
disp_ins(“Percussion”,”struck”,p,n4);
break;
}

}while(ch!=6);
}
// method for accepting the instrument
public static String[] get_Instrument(int t ){
Scanner inp = new Scanner(System.in);
String a[] = new String [50];
for(int i = 0; i<t; i++)
{
a[i]=inp.next();
}
return a;

}
// the method for displaying instrument
public static void disp_ins(String s1, String s2, String [] t,int n){

for(int i = 0; i<n; i++){
System.out.println(“The “+t[i]+” is a “+s1+” instrument and is played by”+ s2+”.”);
}
}
}

sample output:

run:
Select one of the musicial families :
1.Brass
2.String
3.Woodwind
4.Percussion
5.Display all instruments
6.Exit
Enter your choice ->
1
How many brass instruments would you like to enter ->
2
bugle
trumpet
Display instruments?
(Y for Yes, N for No)-> :
y
The bugle is a brass instrument and is played bymouth.
The trumpet is a brass instrument and is played bymouth.
Select one of the musicial families :
1.Brass
2.String
3.Woodwind
4.Percussion
5.Display all instruments
6.Exit
Enter your choice ->
2
How many String instruments would you like to enter ->
1
guitar
Display instruments?
(Y for Yes, N for No)-> :
n
Select one of the musicial families :
1.Brass
2.String
3.Woodwind
4.Percussion
5.Display all instruments
6.Exit
Enter your choice ->
5
The bugle is a brass instrument and is played bymouth.
The trumpet is a brass instrument and is played bymouth.
The guitar is a String instrument and is played byfingers.
Select one of the musicial families :
1.Brass
2.String
3.Woodwind
4.Percussion
5.Display all instruments
6.Exit
Enter your choice ->
6

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?