Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

image text in transcribed

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 A (add) dd a new title to the inventory. Prompt for initial want valuc M ctitles (modify) (delivery) Modity the want value for a specitied title. Take delivery of a shipment of DVDs, assuming that the clerk has entered the shipment information (titles and counts) into a file. Read the file, reserve DVDs for the people on the wait list, and update the have values in the inventory accordingly. Notc that the program must add an item to the inventory if a deliv cred title is not present in the current inventory Write a purchase order for additional DVDs based on a comparison of the have and want values in the inventory, so that the have value is brought up to the want value. (order) (return Write a return order based on a comparison of the have and want values in the inventory and dccrease the have values accordingly (make the return). The purpose is to reduce the have value to the want value. Decrease the count for the specificd title by 1. If the title is sold out, put a name on the wait list for the title S<title save the inventory and wait lists in a file termi- nate execution problem solving process that starts with statement of nd ends program effectively solves problem-that is meets its specitication-has three main stages: l. design solution he implementation final set refinements to new node chapter s linked preceding refrence follow so it references following java statements accomplish these four steps newnode t. next reference prccede th referenced by curr newnode.nextcurr newnode.preceding curr.preceding . newnode.preceding.next insert before inserting ou should convincc yourself work even when yo into beginning list at end which case cure head or an empty also retir- ences node. application: maintaining imagine you have part-time job local movie rental store. realizing know good deal about computers store owner asks wnte interactive will maintain dvds are for sale. consists titles information associated each title: .have value: number currently stock. want be bave value less than valuc more ordered. list: names people waiting titlc if because plans turn oft power computer whn r out closed your not running all times.sates must ter later restore run again ll times s. therefore input output as follows: terminates e contains previously saved command d. single-letter commands--with arguments where nec on incomings shipment d modify user ente pment dvds. cessarythat inq inquire application updated inventory. remove from items whose values zero empty. thus such do appear file. specified individual commands able execute provide summary available commands. command:s i riles display specificd title entire alphabetical order ist> (add) dd a new title to the inventory. Prompt for initial want valuc M ctitles (modify) (delivery) Modity the want value for a specitied title. Take delivery of a shipment of DVDs, assuming that the clerk has entered the shipment information (titles and counts) into a file. Read the file, reserve DVDs for the people on the wait list, and update the have values in the inventory accordingly. Notc that the program must add an item to the inventory if a deliv cred title is not present in the current inventory Write a purchase order for additional DVDs based on a comparison of the have and want values in the inventory, so that the have value is brought up to the want value. (order) (return Write a return order based on a comparison of the have and want values in the inventory and dccrease the have values accordingly (make the return). The purpose is to reduce the have value to the want value. Decrease the count for the specificd title by 1. If the title is sold out, put a name on the wait list for the title S<title save the inventory and wait lists in a file termi- nate execution problem solving process that starts with statement of nd ends program effectively solves problem-that is meets its specitication-has three main stages: l. design solution he implementation final set refinements to>

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

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

=+50. Now deduce Theorem 3.3 from part (a).

Answered: 1 week ago