Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You have been asked by a music company to create a program that will read a file of their music inventory. The data file contains
You have been asked by a music company to create a program that will read a file of their music inventory. The data file contains inventory items such as CD Vinyl Album, and MP files. The first data type of the musicID field tells you which data class the item is in The file follows the layout of each datatype. Your program will allow the user to perform two main functions:
The first function will allow the user to search for an item by the musicID and let the user know the full description of the item and how many items are in the music inventory.
The second function will allow the user to be able to produce a report data output displaying the contents of the inventory search. You will writeout this file so the user knows if the items have been found.
The IT department has given you the user requirements based on the following parameters for the program:
Music is an abstract class
Your data must be stored in a polymorphic array
Your search routine must be recursive.
If the item the user has entered is not in the array your program will throw an exception
Use the following UMLlike layout to create Java classes in which you will write the actual Java code via implementing this program.
Music
Int musicID
String displayltemName
int inventoryQuantity
double itemPrice
CD extends Music
String formatMusic
int playingLength
boolean specialOrder
MP extends Music
String formatMusic
int playingLength
boolean specialOrder
Vinyl Album extends Music
String formatMusic
int playingLength
boolean specialOrder
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