Question
I apologize, but this is the kind of problem I'm looking at. Let me know if there is any other confusion... Please use these classes:
I apologize, but this is the kind of problem I'm looking at. Let me know if there is any other confusion...
Please use these classes: Node, Linked List, Test.
Also, Please keep the code simple.
You have a job at a video store and you want to create a program that will maintain inventory of videos that are for sale. The inventory consists of a list of video titles. Each title has three values: the number of videos in stock, the number that should be in stock, and a waitlist.
For Example:
Video A
In stock: 4
should be: 3
waitlisted: 0
Video B
In stock: 2
Should be: 3
waitlisted: 1
Video C
stock: 5
should be: 5
waitlisted: 0
INPUT: single letter commands (or the methods) used to deal with the linked list.
Please have a predefined linked list that contains the video titles as shown above
please have a predefined linked list that contains information on incoming shipments (see command D)
These single letter commands are the methods of the program
- Display inventory information for a title (I)
- List the inventory by title alphabetically (So a sort)(L)
- add a new title (A)
- modify the want value or the "should be" stock of a title (M)
- Take delivery of a shipment. So, it reads the linked list (as mentioned in the inputs), reserves for the waitlisted and updates the values in the inventory. NOTE: this is where the second linked list, comes in. (D)
- A purchase order that brings the "stock" to the same value as the "Should be" stock. (Too little inventory). - So you would modify the second linked list.(O)
- A return order that does the same thing as mentioned above (too many videos in stock) - this would modify the second linked list. (R)
- Selling will decrease the inventory of a video by 1. (S)
- Quit
Note: I'm very confused and could use the help. Please use java and use a Linked List . Also, keep the code simple. Thanks!
the new node 284 Chapter S Linked Lists 3. Set the preceding refrence in the node that is to follow new node so that it references the new node The following Java statements accomplish these four steps newNode references the new node t. Set the next reference in the node that is to prccede th it references the new node // the node referenced by curr newNode.nextcurr newNode.preceding curr.preceding; curr . preceding newNode; newNode.preceding.next newNode // insert the new node that newNode references before Inserting a node ou should convincc yourself that these statements work even when yo the node into the beginning of a list; at the end of a list, in which case cure references the head node; or into an empty list, in which case curr also retir- ences the head node. 5.4 Application: Maintaining an Inventory Imagine that you have a part-time job at the local movie rental store. Realizing that you know a good deal about computers, the store owner asks you to wnte an interactive program that will maintain the store's inventory of DVDs that are for sale. The inventory consists of a list of movie titles and the following information associated with each title: .Have value: number of DVDs currently in stock. . Want value: number of DVDs that should be in stock. (When the bave value is less than the want valuc, more DVDs are ordered.) . Wait list: list of names of people waiting for the titlc if it is s Because the owner plans to turn oft the power to the computer whn r out is closed, your inventory program will not be running at all times.sates and the program must save the inventory in a file before execution ter later restore the inventory when it is run again ll times s. Therefore, Program input and output are as follows: Input terminates an e that contains a previously saved inventory command D. Single-letter commands--with arguments where nec . A file that contains information on an incomings shipment of D about or modify the inventory and that the user will ente pment of DVDs. (Sec cessarythat inq that inquire Application Maintaining an Inventory 285 Output A file that contains the updated inventory. (Note that you remove from he inventory all items whose have values and want values are zero and whose wait lists are empty. Thus, such items do not appear in the file.) Output as specified by the individual commands he program should be able to execute the following commands (help) Provide a summary of the available commands. Program command:s I riles (inquire) Display the inventory information for a specificd title List the entire inventory (in alphabetical order by ist AStep 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