Giter Club home page Giter Club logo

js-atc-challenge's Introduction

General Assembly Logo

Air Traffic Control Challenge

Prerequisites

Instructions

  1. Fork and clone this repository.
  2. Change into the new directory.
  3. Install dependencies.
  4. Create and checkout a new branch to work on.
  5. Fulfill the listed requirements.

Starter code is available in lib/challenge.js. A pull request is not required, but it is necessary if you want a code review.

You may wish to refer to FAQs related to forking, cloning.

Requirements

We have been contracted to write a software subsystem for an air traffic control system. This software manages a queue of aircrafts and prioritizes the orders of take offs and landings based on the aircraft's type and size. Write a constructor function, ATCQueue, that creates and manages the aircraft queue.

Aircrafts are represented by objects that have at least, but are not limited to, the following properties.

Property Value
type passenger or cargo
size small or large

The aircraft queue should implement the following interface.

Method Parameters Return Notes
aircraftCount() None Integer Count the number of aircrafts in the queue.
enqueue() Aircraft None Add an aircraft to the queue.
dequeue() None Aircraft Remove an aircraft from the queue and return it.

The process that manages the aircraft queue satisfies the following conditions.

  • There is no limit on the size of the aircraft queue.
  • Aircrafts are dequeued according to their priority.
    • Passenger aircrafts have higher priority than cargo aircrafts.
    • If two aircrafts have the same type but different sizes, then the large aircraft has a higher priority.
    • If there is more than one aircraft with the same type and size, then the aircraft that was enqueued earlier has higher priority.

You should be running grunt nag before diagnosing any bugs, since it finds some of the most common sources of errors. After grunt nag passes, you should run grunt test to run the included tests. Tests will tell you whether of not you've met these requirements.

Tasks

Developers should run these often!

  • grunt nag or just grunt: runs code quality analysis tools on your code and complains.
  • grunt reformat: reformats all your code in a standard style.
  • grunt test: runs any automated tests; may depend on grunt build.
  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

js-atc-challenge's People

Contributors

bernardlee avatar jrhorn424 avatar raq929 avatar rdegnen avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

js-atc-challenge's Issues

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.