GithubHelp home page GithubHelp logo

m-zubairahmed / courier-facility-loading-cli Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 20 KB

A command line java program to keep track of goods loading and unloading in storage racks

License: MIT License

Java 100.00%
java cli

courier-facility-loading-cli's Introduction

Courier Facility Loading

A command line java program to keep track of goods loading and unloading in storage racks

Problem Statement

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.

Requirements

  • 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.

Shell commands

Create Rack shelf

To new rack shelf in the facility
create_rack X
X : Positive integer denoting rack size

Store goods

To load good items in the rack shelf
load X Y
X : Positive integer, denoting parcel code
Y : Positive integer, denoting parcel weight

Dispatch goods

To dispatch good items from the rack shelf and prepare for delivery.
dispatch X
X : Positive integer, denoting rack slot number

Search in rack
With weights

slot_numbers_for_parcels_with_weight X
X : Positive integer, denoting parcel weight

With parcel code

slot_number_for_registration_number Y
Y : Positive integers, denoting parcel code

Display Rack

Shows the racks content in a table show_rack

Example Run

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:

1
Input:

create_rack 6

Output:

Created a Rack with 6 shelves

2
Input:

load 1234 400

Output:

Allocated slot number: 1

3
Input:

load 9999 400

Output:

Allocated slot number: 6

4
Input:

load 0001 600

Output:

Allocated slot number: 2

5
Input:

load 7777 100

Output:

Allocated slot number: 5

6
Input:

load 2701 700

Output:

Allocated slot number: 3

7
Input:

load 3141 600

Output:

Allocated slot number: 4

8
Input:

dispatch 5

Output:

Slot number 5 is free

9
Input:

show_rack

Output:
Slot No Registration No Weight
1 1234 400
6 9999 400
2 0001 600
3 2701 700
4 3141 600
10
Input:

load 333 400

Output:

Allocated slot number: 5

11
Input:

load 9999 400

Output:

Sorry,rack is full

12
Input:

parcel_code_for_parcels_with_weight 400

Output:

1234, 9999, 333

13
Input:

slot_numbers_for_parcels_with_weight 400

Output:

1, 6, 5

14
Input:

slot_number_for_registration_number 3141

Output:

4

15
Input:

slot_number_for_registration_number 1111

Output:

Not found in the rack

courier-facility-loading-cli's People

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.