Problem I: Customer orders come in to a warehouse like this:
(customerID, itemNumber, quantity) and these items are prefetched
and brought to a holding area. Then the command to ship to customer
identified by ID comes in, and all the prefetched items are shipped
to that customer in a single box. Assume the total number of items
in the order (sum or quantities) is all that's required to determine
the box size. Assume each customerID is a unique string of
upper-case letters ,
e.g. "JONEXXK" or "BROWKZL".
A. Read from user a sequence of commands:
add (JONEXXK,228700,5) <-- adds this item to the orders
maxq <-- prints out the (customerID, itemNumber, quantity) of order
with the largest quantity seen so far. If no items have
been added yet, print (?,?,?)
quit <-- quits program
B. Assume that the system will not need to process more than 1000 orders
before quitting. Read a sequence of commands:
add (JONEXXK,228700,5) <-- adds this item to the orders
print <-- writes out all the orders (don't care what order they appear)
quit
C. Assume that the system will not need to process more than 1000 orders
before quitting. Read a sequence of commands:
add (JONEXXK,228700,5) <-- adds this item to the orders
print <-- writes out all the order summaries for each customer, like
this:
BROWKZL
108520 4
228700 1
920022 1
Total: 6
JONEXXK
800231 2
920022 1
998735 10
Total: 13
Customers should be listed alphabetically by CustomerID.
quit <-- quits program
D. Make no assumption about number of orders. Now we add a command
to ship to a customer, which should print a summary of the order,
and remove the shipped orders from storage. If a customerID is
entered with the ship command for which there are no unshipped
orders, print "No orders pending!".
add
ship CustomerID
quit