Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Its how to Write a program to monitor the flow of an item into and out of a warehouse. The warehouse will have numerous deliveries
- Its how to Write a program to monitor the flow of an item into and out of a warehouse. The warehouse will have numerous deliveries and shipments for this item (a widget) during the time covered. A shipment is billed at a profit of 50 percent over the cost of a widget. Unfortunately, each shipment received may have a different cost associated with it. The accountants for the firm have instituted a last-in, first-out system for filling orders. This means. that the newest widgets are the first ones sent out to fill an order. This member function of inventory can be represented using a stack. The push operator will insert a shipment received. The pop operator will delete a shipment out. Input: Input data will come from a file named hw1in.txt and will consist of the following: • s or o: shipment received or an order to be sent • amount: The quantity received or shipped out • cost: cost per widget (for received shipments only) • vendor: a character string that names the company sent to or received from For example, the data fragment below indicates that 100 widgets were received from RCA at $10.50 per widget and 50 were shipped to Boeing: s 100 10.50 RCA o 50 Boeing Since there may not be enough widgets to fill an order in the warehouse, all orders should be placed on a queue while they are waiting to be filled. Orders are placed and fulfilled in first- come first-served order. Output: Output for an order (Exam2.txt) will consist of vendor, the quantity, and the total price for all the widgets in the order. (Hint: Each widget price is 50 percent higher than its cost. The widgets to fill an order may come from multiple shipments with different costs.). Program Structure: Your program should create at least three classes: Stack, Queue, and Inventory (you will probably need at least one additional class to serve as the data element in your stack and queue to hold the shipment and/or order information). You are required to use a linked list for the Stack and Queue without the benefit of any library objects (i.e. you cannot use a Stack, Queue, or LinkedList library classes so you have to implement them using classes. you create). The Inventory class will contain an instance of the Stack and Queue classes and should provide methods to handle the orders and shipments. Here is a basic algorithm for your main driver program: Open the input file Instantiate and pass the input file to an Inventory class. Call a method in the Inventory class instance to process the input file and return an output string with the information detailed in the Output section above. Write the output data to the output file. and explain why uses those classes why is written in that way. why the code is written, and you will prove with that its not only zip and send, please consult over private if you agree upon my request. Thank you. Tons of works
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