Question
The program needed shoud compile a list of instruments from different instrument families. A family of musical Instruments is a grouping of several different but
The program needed shoud 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.
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:
o BlownInstrument o Fingered o Struck
Use four separate (external to the main class) subclasses (families) that extend the appropriate three above:
o Brass o Strings o Woodwind o 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?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started