A command line java program to keep track of goods loading and unloading in storage racks
We own a courier facility which segregate the courier for different cities into different racks that can hold up to 'n' packages at any given point in time. Each level in the rack has 2 slots. The slots is given a number first to all in one column starting at 1 increasing with increasing level from the entry point in steps of one till n/2 and then to the second column as n/2+1 at the of the topmost level decreasing by 1 at each lower level. We want to create an automated ticketing system that allows my facility man to use my allotted slot without any error.
Eg: if I have a rake with 10 slots, the arrangement will be like:
5 | 6 |
4 | 7 |
3 | 8 |
2 | 9 |
1 | 10 |
When a parcel enters my racks, we want to have a ticket issued to the parcel. The ticket issuing process includes us documenting the parcel code and the weight(in gm) of the parcel and allocating an available slot to the parcel before actually handing over a ticket to the facility man(we assume that our facility men are nice enough to always park in the slots allocated to them). The Parcel should be allocated a slot which is nearest to the entry. At the exit the customer returns the ticket which then marks the slot they were using as being available.
- Program should provide with an interactive command prompt based shell where commands can be typed in.
- The system should provide me with the ability
to find out:
- Parcel codes of all parcels of a particular weight.
- Slot number in which a parcel with a given code is parked.
- Slot numbers of all slots where a parcel of a particular weight is parked.
To new rack shelf in the facility
create_rack X
X : Positive integer denoting rack size
To load good items in the rack shelf
load X Y
X : Positive integer, denoting parcel code
Y : Positive integer, denoting parcel weight
To dispatch good items from the rack shelf and prepare for delivery.
dispatch X
X : Positive integer, denoting rack slot number
slot_numbers_for_parcels_with_weight X
X : Positive integer, denoting parcel weight
slot_number_for_registration_number Y
Y : Positive integers, denoting parcel code
Shows the racks content in a table
show_rack
Assuming a parcel slot with 6 slots, the following commands should be run in sequence by typing them in at a prompt and should produce output as described below the command:
create_rack 6
Created a Rack with 6 shelves
load 1234 400
Allocated slot number: 1
load 9999 400
Allocated slot number: 6
load 0001 600
Allocated slot number: 2
load 7777 100
Allocated slot number: 5
load 2701 700
Allocated slot number: 3
load 3141 600
Allocated slot number: 4
dispatch 5
Slot number 5 is free
show_rack
Slot No | Registration No | Weight |
---|---|---|
1 | 1234 | 400 |
6 | 9999 | 400 |
2 | 0001 | 600 |
3 | 2701 | 700 |
4 | 3141 | 600 |
load 333 400
Allocated slot number: 5
load 9999 400
Sorry,rack is full
parcel_code_for_parcels_with_weight 400
1234, 9999, 333
slot_numbers_for_parcels_with_weight 400
1, 6, 5
slot_number_for_registration_number 3141
4
slot_number_for_registration_number 1111
Not found in the rack