Answered step by step
Verified Expert Solution
Link Copied!

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 MP3 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 write-out 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 UML-like 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
MP3 extends Music
String formatMusic
int playingLength
boolean specialOrder
Vinyl Album extends Music
String formatMusic
int playingLength
boolean specialOrder
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions