QuestionQuestion

Transcribed TextTranscribed Text

Write a menu-driven program to handle the flow of widgets into and out of a warehouse. The warehouse will have numerous deliveries of new widgets and orders for widgets The widgets in a filled order are billed at a profit of 50 percent over their cost Each delivery of new widgets may have a different cost associated with it The accountants for the firm have instituted a last-in, first-out system for filling orders the newest widgets are the first ones sent out to fill an order and the most recent orders are filled first o partial shipments allowed Assign numbers to the orders and deliveries This function of inventory can be represented using two stacks: orders-to-be-filled and widgets-on-hand. When a delivery of new widgets is received, any unfilled orders (on the orders-to-be- filled stack) are processed and filled. After all orders are filled, if there are widgets remaining in the new delivery, a new element is pushed onto the widgets-on-hand stack. When an order for new widgets is received, one or more objects are popped from the widgets-on-hand stack until the order has been filled. If the order is completely filled and there are widgets left over in the last object popped, a modified object with the quantity updated is pushed onto the widgets-on-hand stack. If the order is not completely filled, the order is pushed onto the orders-to-be-filled stack with an updated quantity of widgets to be sent out later. After an order is fully or a partially filled display the following: o order number quantity ordered o quantity shipped o price per widget and the total cost for all widgets in the order o indicate whether there are any widgets remaining to be sent out at a later time. After delivery is processed display information about each order that was filled with this delivery. Keep track of number of widgets in stock and number of widgets shipped. Make sure each function definition is preceded by a description, post and pre conditions Create menu options to display the details of the inventory on hand (delivery stack) and the details of the outstanding orders (shipment/order stack) You may implement the stack as an array or a linked list Well format the output: all numbers should be right aligned; see the sample below Create a test plan (hand-written or typed); the test plan has be approved for the instructor before you can submit the lab. Order Number 123 Qty to Ordered 25 Qty Shipped this Shipment 10 Qty to be Shipped 5 Total Cost to the Warehouse 28.25 Total Cost to the Customer 42.38 Profit this Shipment 14.13 Shipment details Qty Shipped Unit Price Cost to the Warehouse Cost to the Customer 5 2.5 12.5 18.75 3 1.75 5.25 7.88 2 5.25 10.5 15.75

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

/*
* File:   main.cpp
* Author:
*
*
*/

#include <cstdlib>
#include <iostream>
#include <iomanip>
#include "Order.h"

#include "StackOrder.h"
#include "StackWidget.h"

using namespace std;


void printMainMenu();
void addWidget(StackWidget & widgets_on_hand);
void addOrder(StackOrder & orders_to_be_filled);
void fillOrder(StackWidget & widgets_on_hand,
       StackOrder & orders_to_be_filled);
void prinitAll(StackWidget & widgets_on_hand,
       StackOrder & orders_to_be_filled);


int Order::number = 0;

/**
* main function
* pre condition : None
* post condition : None
* @param argc
* @param argv
* @return
*/...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$64.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Computer Science - Other Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats