Giter Club home page Giter Club logo

sorting_hat's Introduction

Project Description

Implement SortingHat : A school hostel assignment Program New students join a school and need to be assigned to one of 4 boarding houses. As students come in, they register their roll number, class & food preference. There are 2 classes - A and B, and two food preferences - V & NV. There are 4 boarding houses with equal but limited capacity. The hat follows a first in first out policy with the following rules - ● Queue will be processed based on the time a student registered, first in first out ● Boarding houses for students who prefer V cannot board NV students ● Boarding houses for class A would be separate from boarding houses for class B ● Once all boarding houses are filled up to capacity, no more students can be allocated. ● Other rules ○ Roll number is a 4 digit integer unique to each student ○ Student can only be registered once, duplicate commands for same student may be ignored

How to use

There are 2 ways to registered students to boarding house

For file input:

  • Add file name in Configuration --> Use Edit Configuration and add file name --> "./bin/sorting_hat_input_file.txt"

  • Run your project you can see the output for operation command specified in file.

ScreenShot Of File output for reference :-

example output for file

For input from terminal: Note :- If you earlier have registered students using file, please remove path from config file and then try from terminal.

  • Use command to create boarding house with equal capacity, give total number of student capacity which can be equal for each boarding house :- init 12 (12 is total number so 12/4 = 3 student capacity for each boarding house)

  • Use command to registered students :- reg 1 B V

  • use command to exit and see output :- fin

ScreenShot Of Terminal output for reference :-

example output for terminal

Author

Vrushali

sorting_hat's People

Contributors

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